pub struct BindingRegistry { /* private fields */ }Expand description
Shared registry of all active property bindings.
Indexed by source-signal identity (source_id) so the per-frame
flush iterates unique sources rather than every binding. Typical
catalog scene: ~30-40 unique sources covering 100-300+ bindings
(every reactive theme query, every label, every visibility
signal pulls a binding off the same shared root).
One registry per WidgetTree, and that
matters: the registry is where “have I acted on this change yet?” is
remembered, so two windows sharing a Signal each answer it for
themselves. Cloning a BindingRegistry shares the same state (it is
Rc-backed) and is only ever done to hold onto one tree’s registry,
never to hand a second tree the first tree’s bookkeeping.
Implementations§
Source§impl BindingRegistry
impl BindingRegistry
pub fn new() -> Self
Sourcepub fn any_dirty(&self) -> bool
pub fn any_dirty(&self) -> bool
Whether any bound source has advanced past what this registry
last acted on — i.e. whether a flush_all_dirty right now would
return anything.
O(S) u64 comparisons over unique sources, with no arena walk,
no rebuilds and no layout. Read-only: unlike the flush it does
NOT advance last_seen, so asking is free of consequence and can
be repeated.
Exists because a poll-based design can otherwise only answer
“does this tree have pending reactive work?” by running the whole
reconcile pass. Cross-window schedulers care about that question
— see teksilo_app::WindowManager::request_redraw_needing_render.
Trait Implementations§
Source§impl Clone for BindingRegistry
impl Clone for BindingRegistry
Source§fn clone(&self) -> BindingRegistry
fn clone(&self) -> BindingRegistry
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more