pub struct StatusCenter {
pub status: Option<StatusMessage>,
pub toast: Option<StatusMessage>,
pub toast_queue: VecDeque<StatusMessage>,
}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.
Fields§
§status: Option<StatusMessage>§toast: Option<StatusMessage>§toast_queue: VecDeque<StatusMessage>Implementations§
Source§impl StatusCenter
impl StatusCenter
pub fn set_status(&mut self, text: impl Into<String>, is_error: bool)
Sourcepub fn set_info_status(&mut self, text: impl Into<String>)
pub fn set_info_status(&mut self, text: impl Into<String>)
Set an Info-class status message that displays in the footer only.
Sourcepub fn set_background_status(&mut self, text: impl Into<String>, is_error: bool)
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.
Sourcepub fn set_sticky_status(&mut self, text: impl Into<String>, is_error: bool)
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.
Sourcepub fn clear_sticky_status(&mut self)
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.
Sourcepub fn tick_toast(&mut self)
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
impl Default for StatusCenter
Source§fn default() -> StatusCenter
fn default() -> StatusCenter
Auto Trait Implementations§
impl Freeze for StatusCenter
impl RefUnwindSafe for StatusCenter
impl Send for StatusCenter
impl Sync for StatusCenter
impl Unpin for StatusCenter
impl UnsafeUnpin for StatusCenter
impl UnwindSafe for StatusCenter
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
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