Skip to main content

Model

Struct Model 

Source
pub struct Model {
Show 17 fields pub ceremony_name: Option<String>, pub ceremony_description: Option<String>, pub ceremony_materials: Vec<MaterialOverview>, pub ceremony_step_count: Option<usize>, pub role_names: HashMap<RoleId, String>, pub system_info: Option<SystemInfo>, pub environment: Option<Environment>, pub screen: Screen, pub return_to: Option<Screen>, pub current_step: Option<StepView>, pub log: VecDeque<LogLine>, pub deviations: Vec<DeviationView>, pub pending_prompt: Option<PendingPrompt>, pub running: RunningState, pub tick: u64, pub now: DateTime<Local>, pub log_scroll: usize, /* private fields */
}
Expand description

Top-level UI state. A single Screen discriminant captures what the user is looking at, so the borrow checker enforces that we can’t render two contradictory views.

Fields§

§ceremony_name: Option<String>

Ceremony name, as soon as CeremonyStarted arrives.

§ceremony_description: Option<String>

Ceremony description, as authored in the DSL.

§ceremony_materials: Vec<MaterialOverview>

Declared materials. Populated from CeremonyStarted.

§ceremony_step_count: Option<usize>

Total number of steps in the execution plan, when known.

§role_names: HashMap<RoleId, String>

Role display names, from the RoleDeclared facts at ceremony start.

§system_info: Option<SystemInfo>

Static build/host identity for the System tab. Populated from UiSignal::SystemInfo, emitted once at ceremony start.

§environment: Option<Environment>

Live device environment for the System tab. Populated from UiSignal::Environment; replaced wholesale on each re-emission.

§screen: Screen

Current screen.

§return_to: Option<Screen>

Screen to restore when a modal is dismissed. None when the current screen is itself the underlying step screen.

§current_step: Option<StepView>

Most-recent step being executed, if any.

§log: VecDeque<LogLine>

Bounded log feed.

§deviations: Vec<DeviationView>

Deviations recorded so far.

§pending_prompt: Option<PendingPrompt>

Pending prompt the runtime is awaiting an answer to.

§running: RunningState

Lifecycle phase.

§tick: u64

Frame counter for spinner animation. Advances on every Tick.

§now: DateTime<Local>

Wall-clock snapshot, refreshed on every Tick. Rendered in the header bar; kept in the model so view stays pure and snapshot tests can pin a deterministic time.

§log_scroll: usize

Log-tab scroll offset, counted in lines up from the tail. 0 = following the tail; positive = scrolled into history. Clamped to log.len() whenever the feed is pushed or evicted.

Implementations§

Source§

impl Model

Source

pub fn new() -> Self

Build a fresh model.

Source

pub fn has_active_spinner(&self) -> bool

Whether the log feed currently ends with an active spinner that must keep animating. Invariant: push_log converts any prior trailing Icon::Spinner to a Checkmark, so at most the tail entry can be an active spinner.

Source

pub fn clock_display_key(&self) -> (u32, u32)

Equivalence key for the visible header clock. The colon blinks on second parity and the minute is the smallest displayed unit, so the rendered header changes iff this key changes.

Trait Implementations§

Source§

impl Debug for Model

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Model

Source§

fn default() -> Self

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

Auto Trait Implementations§

§

impl Freeze for Model

§

impl RefUnwindSafe for Model

§

impl Send for Model

§

impl Sync for Model

§

impl Unpin for Model

§

impl UnsafeUnpin for Model

§

impl UnwindSafe for Model

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<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> 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.