struct Novika::StructViewForm

Overview

A thin wrapper around FFI::StructView and its descendants.

This form is a readable and submittable store, which means you can read (e.g. entry:fetch) and submit (e.g. entry:submit) to exsisting entries.

Included Modules

Defined in:

novika/forms/foreign.cr

Constructors

Class Method Summary

Instance Method Summary

Instance methods inherited from module Novika::ISubmittableStore

submit(name : Form, form : Form) submit, submit?(name : Form, form : Form) submit?

Class methods inherited from module Novika::ISubmittableStore

typedesc typedesc

Instance methods inherited from module Novika::IReadableStore

form_for(name : Form) : Form form_for, form_for?(name : Form) : Form | Nil form_for?, has_form_for?(name : Form) : Bool has_form_for?, opener?(name : Form) : Bool opener?, pusher?(name : Form) : Bool pusher?

Class methods inherited from module Novika::IReadableStore

typedesc typedesc

Instance methods inherited from module Novika::Form

a(type : T.class) : T forall T a, desc(io : IO)
desc : String
desc
, die(details : String) die, effect(io)
effect
effect
, on_open(engine : Engine) : self on_open, on_parent_open(engine : Engine) : self on_parent_open, onto(block : Block) : self onto, sel(a, b) sel, to_quote : Quote to_quote

Instance methods inherited from module Novika::Schedulable

schedule(engine : Engine, stack : Block) schedule, schedule!(engine : Engine, stack : Block) schedule!

Constructor Detail

def self.new(view : Novika::FFI::StructView) #

Class Method Detail

def self.typedesc #

Instance Method Detail

def ==(other : self) #

Returns whether this and other struct views are equal. Performs deep, recursive equality based on the fields' values. Supports self-reference, mutual reference, etc.


def address(*args, **options) #

Returns the address of the underlying struct in memory.


def address(*args, **options, &) #

Returns the address of the underlying struct in memory.


def desc(io) #

def form_for?(name : Form) : Form | Nil #
Description copied from module Novika::IReadableStore

Returns the value form for an entry with the given name, or nil if no such entry exists.


def has_form_for?(name : Form) : Bool #
Description copied from module Novika::IReadableStore

Returns whether this store has an entry with the given name.


def inline? #

Returns whether this view is an inline struct view.


def layout : StructLayoutForm #

Returns the struct layout of the underlying struct view.


def opener?(name : Form) : Bool #
Description copied from module Novika::IReadableStore

Returns whether name opens its value form, as defined in this store. Dies if name is not defined in this store.


def pusher?(name : Form) : Bool #
Description copied from module Novika::IReadableStore

Returns whether name pushes its value form, as defined in this store. Dies if name is not defined in this store.


def reference? #

Returns whether this view is a struct reference view.


def submit?(name : Form, form : Form) #
Description copied from module Novika::ISubmittableStore

Submits value form to an entry with the given name. Returns nil if no such entry exists.


def to_s(io) #

def union? #

Returns whether this view is a union view.


def view : FFI::StructView #

Returns the underlying struct view.