pub struct ToastState { /* private fields */ }Expand description
State for managing toast visibility and expiration
Implementations§
Source§impl ToastState
impl ToastState
Sourcepub fn show(&mut self, message: impl Into<String>, duration_ms: i64)
pub fn show(&mut self, message: impl Into<String>, duration_ms: i64)
Show a toast message for a specified duration (in milliseconds)
Sourcepub fn get_message(&self) -> Option<&str>
pub fn get_message(&self) -> Option<&str>
Get the current message if the toast hasn’t expired
Sourcepub fn is_visible(&self) -> bool
pub fn is_visible(&self) -> bool
Check if a toast is currently visible
Sourcepub fn clear_if_expired(&mut self)
pub fn clear_if_expired(&mut self)
Clear the toast if it has expired
Trait Implementations§
Source§impl Clone for ToastState
impl Clone for ToastState
Source§fn clone(&self) -> ToastState
fn clone(&self) -> ToastState
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ToastState
impl Debug for ToastState
Source§impl Default for ToastState
impl Default for ToastState
Source§fn default() -> ToastState
fn default() -> ToastState
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ToastState
impl RefUnwindSafe for ToastState
impl Send for ToastState
impl Sync for ToastState
impl Unpin for ToastState
impl UnwindSafe for ToastState
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
Mutably borrows from an owned value. Read more
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>
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 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>
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