Skip to main content

StatusCenter

Struct StatusCenter 

Source
pub struct StatusCenter { /* private fields */ }
Expand description

Status/toast-owned state grouped off the App god-struct. Contains the footer status message, the active toast and the toast queue. Pure state container plus the routing helpers that only touch these three fields. tick_status stays on App because it must read syncing_providers to suppress expiry during in-flight provider syncs.

Implementations§

Source§

impl StatusCenter

Source

pub fn status(&self) -> Option<&StatusMessage>

Source

pub fn status_mut(&mut self) -> Option<&mut StatusMessage>

Source

pub fn toast(&self) -> Option<&StatusMessage>

Source

pub fn toast_mut(&mut self) -> Option<&mut StatusMessage>

Source

pub fn take_status(&mut self) -> Option<StatusMessage>

Source

pub fn restore_status(&mut self, message: Option<StatusMessage>)

Source

pub fn set_toast_message(&mut self, message: Option<StatusMessage>)

Source

pub fn drop_toasts_where(&mut self, matches: impl FnMut(&StatusMessage) -> bool)

Drop the active toast and queued entries whose body matches the predicate. The active slot is refilled from the head of the queue.

Source

pub fn set_status(&mut self, text: impl Into<String>, is_error: bool)

Source

pub fn set_info_status(&mut self, text: impl Into<String>)

Set an Info-class status message that displays in the footer only.

Source

pub fn set_background_status(&mut self, text: impl Into<String>, is_error: bool)

Like notify but skips the write when a sticky message is active. Use for background/timer events (ping expiry, sync ticks) that must not clobber an in-progress or critical sticky message. Routes to Info (footer) by default, Error toast if is_error.

Source

pub fn set_sticky_status(&mut self, text: impl Into<String>, is_error: bool)

Sticky messages always go to the footer (self.status), even when the class is Error. The sticky flag overrides the normal toast routing because sticky messages (Vault SSH signing summaries, progress spinners) must remain visible in the footer until explicitly replaced.

Source

pub fn clear_sticky_status(&mut self)

Drop the sticky footer status (set by set_sticky_status / notify_progress). Long-running operations call this when they finish so the “Pushing X…” line does not linger after the transient success/partial toast lands on top of it.

Source

pub fn tick_toast(&mut self)

Tick the toast message timer. Uses wall-clock time via created_at so expiry is independent of the tick rate. Called every tick; the actual check is created_at.elapsed() > timeout_ms().

Trait Implementations§

Source§

impl Default for StatusCenter

Source§

fn default() -> StatusCenter

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

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<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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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