Skip to main content

DefaultBinder

Struct DefaultBinder 

Source
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::Value at the LOD the body itself baked in (per-call lod= option, default Lod::Labeled).
  • Multiple bodies bound to the same slot fire in order (the composition rule from SRD-63 §5.5).

Implementations§

Source§

impl DefaultBinder

Source

pub fn new() -> Self

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl ReadoutBinder for DefaultBinder

Source§

fn fire( &mut self, event: EventType, ctx: &dyn ReadoutContext, sink: &mut dyn ReadoutSink, )

Drive every readout bound to event. The binder applies its interactive state, walks the resolved list, and emits render steps to sink.
Source§

fn on_key(&mut self, _key: BinderKey)

Forward a keyboard event from the surface. Default no-op for non-interactive sinks.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more