pub struct DefaultBinder { /* private fields */ }Expand description
Stateless default binder. Holds a slot → Vec<BakedBody>
map; on fire(event) walks the matching slot’s bodies
in declaration order. Push 5 introduces a stateful
TuiReadoutBinder alongside.
Behaviour:
- No focus state, no LOD overrides, no overlay-held flag.
- Each baked body fires with
ContentMode::Valueat the LOD the body itself baked in (per-calllod=option, defaultLod::Labeled). - Multiple bodies bound to the same slot fire in order (the composition rule from SRD-63 §5.5).
Implementations§
Source§impl DefaultBinder
impl DefaultBinder
pub fn new() -> Self
Sourcepub fn bind(&mut self, event: EventType, body: BakedBody)
pub fn bind(&mut self, event: EventType, body: BakedBody)
Bind a baked body to an event slot. Multiple calls with the same event append in order.
Sourcepub fn set(&mut self, event: EventType, body: BakedBody)
pub fn set(&mut self, event: EventType, body: BakedBody)
Replace whatever’s at this slot with a single body — Form A / B’s “scalar means single-element list” path.
Sourcepub fn slot_len(&self, event: EventType) -> usize
pub fn slot_len(&self, event: EventType) -> usize
Number of bodies bound to this slot. 0 means the
event will fire and produce no output — surfaces
expecting a default render need to seed builtins
before calling fire.
Sourcepub fn merge(&mut self, other: DefaultBinder)
pub fn merge(&mut self, other: DefaultBinder)
Drain other’s bindings into self, appending each
body to its slot. Used by the CLI-override resolver
to combine the workload-+-default-resolved binder
with a CLI-supplied extra body.
Sourcepub fn unbind(&mut self, event: EventType)
pub fn unbind(&mut self, event: EventType)
Drop every body bound to event. Surfaces that
want “no readouts at this slot” call this rather
than binding an empty body.
Sourcepub fn take_bodies(&mut self, event: EventType) -> Vec<BakedBody>
pub fn take_bodies(&mut self, event: EventType) -> Vec<BakedBody>
Remove and return the resolved bodies bound to event, leaving the
slot empty. SRD-100 P2 — the executor extracts the resolved
on_update template from a freshly-built binder to attach to the
live render handle (PhaseRenderHandle::bodies), so the consumer
can fire it with &self without holding the !Sync binder.
Trait Implementations§
Source§impl Default for DefaultBinder
impl Default for DefaultBinder
Source§impl ReadoutBinder for DefaultBinder
impl ReadoutBinder for DefaultBinder
Source§fn fire(
&mut self,
event: EventType,
ctx: &dyn ReadoutContext,
sink: &mut dyn ReadoutSink,
)
fn fire( &mut self, event: EventType, ctx: &dyn ReadoutContext, sink: &mut dyn ReadoutSink, )
event. The binder
applies its interactive state, walks the resolved
list, and emits render steps to sink.Auto Trait Implementations§
impl !RefUnwindSafe for DefaultBinder
impl !UnwindSafe for DefaultBinder
impl Freeze for DefaultBinder
impl Send for DefaultBinder
impl Sync for DefaultBinder
impl Unpin for DefaultBinder
impl UnsafeUnpin for DefaultBinder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more