pub struct TuiReadoutBinder { /* private fields */ }Expand description
Stateful runtime adapter for the TUI surface (SRD-63 §7).
Wraps a DefaultBinder with three pieces of
interactive state:
- Focus index — which baked body in each slot is
currently “selected” by the user. The focused body’s
render emits with
LayoutHint::Focused(...)so the sink can apply visual emphasis (offset, background tint). - Per-(slot, body) LOD overrides — keystrokes cycle the focused body’s LOD up / down; the binder applies overrides on top of the body’s baked LOD.
- Overlay-held flag — while true, every render
fires with
ContentMode::Explanationinstead ofValue. Driven by a held key on the surface.
The binder forwards fire through to its inner
DefaultBinder for actual rendering, then post-
processes by applying the focus / LOD / overlay state
via a wrapping render walk.
Construction is the same as a default binder — same slot bindings — but the surface keeps a long-lived instance so state survives across event fires.
Implementations§
Source§impl TuiReadoutBinder
impl TuiReadoutBinder
pub fn new() -> Self
Sourcepub fn from_default(inner: DefaultBinder) -> Self
pub fn from_default(inner: DefaultBinder) -> Self
Construct from an existing DefaultBinder. Used by
the activity-init plumbing — build the bindings via
the standard layered resolver, then wrap in the
stateful TUI binder for the live surface.
pub fn bind(&mut self, event: EventType, body: BakedBody)
pub fn slot_len(&self, event: EventType) -> usize
Sourcepub fn focus_for(&self, event: EventType) -> Option<usize>
pub fn focus_for(&self, event: EventType) -> Option<usize>
Read the current focus index for a slot. Returns
Some(i) when a body in event’s list is focused;
None when the slot has no bodies or focus is
inactive.
Sourcepub fn overlay_held(&self) -> bool
pub fn overlay_held(&self) -> bool
Read the active overlay-held flag. Visible to the surface so it can render an “explanation overlay active” affordance in chrome.
Trait Implementations§
Source§impl Default for TuiReadoutBinder
impl Default for TuiReadoutBinder
Source§impl ReadoutBinder for TuiReadoutBinder
impl ReadoutBinder for TuiReadoutBinder
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 TuiReadoutBinder
impl !UnwindSafe for TuiReadoutBinder
impl Freeze for TuiReadoutBinder
impl Send for TuiReadoutBinder
impl Sync for TuiReadoutBinder
impl Unpin for TuiReadoutBinder
impl UnsafeUnpin for TuiReadoutBinder
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