pub struct Toasts { /* private fields */ }Expand description
A stack of active toasts. Cheap to keep in app state.
Implementations§
Source§impl Toasts
impl Toasts
pub fn new() -> Self
pub fn anchor(self, anchor: ToastAnchor) -> Self
pub fn width(self, w: f32) -> Self
Sourcepub fn add(
&mut self,
variant: Variant,
title: Option<String>,
message: impl Into<String>,
)
pub fn add( &mut self, variant: Variant, title: Option<String>, message: impl Into<String>, )
Push a toast with an explicit variant and 4s duration.
pub fn info(&mut self, title: impl Into<String>, message: impl Into<String>)
pub fn success(&mut self, title: impl Into<String>, message: impl Into<String>)
pub fn warning(&mut self, title: impl Into<String>, message: impl Into<String>)
pub fn error(&mut self, title: impl Into<String>, message: impl Into<String>)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Toasts
impl RefUnwindSafe for Toasts
impl Send for Toasts
impl Sync for Toasts
impl Unpin for Toasts
impl UnsafeUnpin for Toasts
impl UnwindSafe for Toasts
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