module pkg::alloy::ui::storesource
Signals, the bindings reading them and the owners everything made belongs to.
A binding is an effect: a function run with the reads it makes recorded, each read subscribing it to the signal, stamped with the run that made it. A change marks the subscribers whose stamp is their last run's and drops the rest, so a run forgets what it no longer reads without unsubscribing. Marked effects run once the handler returns, owners nearer the root first.
ReaderSignalSlotEffectOwnerSlotchanged_signalpeekpeek_varnew_effectset_effecttrackedrun_effectflushread_shownsignal_alivenew_ownerfree_ownerowner_indexowner_givenowned
type Readersource
exp type Reader = struct
Fields
exp effect: u32exp run: u32
type SignalSlotsource
exp type SignalSlot = struct
Fields
exp generation: u32exp readers: Vector<Reader>
type Effectsource
exp type Effect = struct
Fields
exp alive: boolexp generation: u32exp run: Option<|=| (&var Ui)>exp runs: u32exp node: Option<u32> = ::Nonethe element it makes or fills
type OwnerSlotsource
exp type OwnerSlot = struct
What a view made: freed together, with the owners made under it.
Fields
exp generation: u32 = 0of the Owner handles naming it
fn changed_signalsource
exp fn changed_signal(self ui: &var Ui, index: u32)
Marks the effects that read the signal in their last run.
fn peeksource
exp fn peek<T>(self signal: &Signal<T>, ui: &Ui) -> &T
The value with no read recorded nor change marked: the framework's own state kept in signals.
fn peek_varsource
exp fn peek_var<T>(self signal: &Signal<T>, ui: &var Ui) -> &var T
fn new_effectsource
exp fn new_effect(self ui: &var Ui) -> u32
fn set_effectsource
exp fn set_effect(self ui: &var Ui, effect: u32, node: Option<u32>, run: |=| (&var Ui))
Gives the effect what it runs, and the element it makes or fills, if any: what is busy while it shows a resource loading.
fn trackedsource
exp fn tracked<R>(self ui: &var Ui, effect: u32, f: &|&| (&Ui) -> R) -> R
The function's result, its reads subscribing the effect.
fn run_effectsource
exp fn run_effect(self ui: &var Ui, effect: u32)
Runs the effect, what it makes belonging to its owner.
fn flushsource
exp fn flush(self ui: &var Ui)
Runs the marked effects, those of owners nearer the root first, then those of lower index; effects they mark run in the same pass. Those of a hidden view wait for it to show.
fn read_shownsource
exp fn read_shown(self ui: &Ui, index: u32) -> bool
Whether a binding shown reads the signal: one whose last run read it, not in a hidden view.
fn signal_alivesource
exp fn signal_alive(self ui: &Ui, index: u32, generation: u32) -> bool
Whether the signal is still there.
fn new_ownersource
exp fn new_owner(self ui: &var Ui, parent: u32) -> u32
fn free_ownersource
exp fn free_owner(self ui: &var Ui, owner: u32)
Frees what the owner made, and the owners made under it.
fn owner_indexsource
exp fn owner_index(self ui: &Ui, owner: Owner) -> u32
The owner the handle names, faulting once it went.
fn owner_givensource
exp fn owner_given(self ui: &Ui, owner: Option<Owner>) -> u32
The owner given, else what is being made now belongs to.
fn ownedsource
exp fn owned<R>(self ui: &var Ui, owner: u32, f: &|&| (&var Ui) -> R) -> R
Runs the function as a new owner under the one now.