pub struct StatusMessage {
pub text: String,
pub class: MessageClass,
pub tick_count: u32,
pub sticky: bool,
pub created_at: Instant,
}Expand description
Status message displayed as toast overlay or in the footer.
Fields§
§text: String§class: MessageClass§tick_count: u32Retained for backward compatibility with tests that inspect it.
Expiry logic uses created_at (wall-clock) instead.
sticky: boolWhen true the message never auto-expires and notify_background
will not overwrite it. Cleared by notify or notify_progress.
created_at: InstantWall-clock instant when the message was created. Used by the drain
bar renderer for smooth (frame-rate-independent) animation instead
of the discrete tick_count.
Implementations§
Source§impl StatusMessage
impl StatusMessage
Sourcepub fn timeout_ms(&self) -> u64
pub fn timeout_ms(&self) -> u64
Timeout in milliseconds for this message class.
Length-proportional: shorter messages clear faster, longer messages
stay visible longer to give the user time to read. The minimum keeps
1-word messages on screen long enough to register; the per-word
component scales with reading time. Errors and Progress are sticky
(return u64::MAX).
All timing is in wall-clock milliseconds, independent of the tick
rate. Both tick_toast (expiry) and render_toast (drain bar)
compare created_at.elapsed() against this value.
Trait Implementations§
Source§impl Clone for StatusMessage
impl Clone for StatusMessage
Source§fn clone(&self) -> StatusMessage
fn clone(&self) -> StatusMessage
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for StatusMessage
impl RefUnwindSafe for StatusMessage
impl Send for StatusMessage
impl Sync for StatusMessage
impl Unpin for StatusMessage
impl UnsafeUnpin for StatusMessage
impl UnwindSafe for StatusMessage
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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