Skip to main content

Module program

Module program 

Source
Expand description

The descriptor a compiled program hands the runtime: its states, windows, views and the compiled functions behind every dynamic part of their UI.

nf build emits these as data next to the machine code, laid out as the #[repr(C)] types here say, so their layout is the contract between the two.

Structs§

BindingDesc
FrameDesc
The types of a frame’s locals; a frame starts with every local empty.
MenuDesc
A menu: its title and its entries.
MenuEntryDesc
One entry of a menu. Which fields matter depends on kind:
ProgramDesc
Every function returns false after a runtime call recorded why it failed.
RegionDesc
ShortcutDesc
An item’s shortcut, which shortcut holds when present.
SpanDesc
StateDesc
TemplateDesc
One element of a window’s UI. Which fields matter depends on kind:
ViewDesc
WindowDesc

Enums§

MenuEntryKind
TemplateKind

Constants§

ABI_VERSION
Bumped whenever these layouts or the meaning of a runtime call change, so a program built against another runtime is refused instead of misread.

Type Aliases§

ActionFn
Runs a button’s action in a copy of its frame, which it may change.
ExpandFn
Tells sink what a region shows now, through the nf_show_* calls.
InitFn
Writes a state’s starting value to out.
ReadFn
Writes the value a piece of UI shows, such as a string, an int or a bool, to out; frame holds its locals.
WriteFn
Writes value, which it takes ownership of, to a bound place.