pub struct Toast { /* private fields */ }Expand description
A single enqueued notification.
Construct with Toast::new, configure via the builder methods, then
call Toast::show to enqueue. The toast is rendered the next time
Toasts::render runs.
Implementations§
Source§impl Toast
impl Toast
Sourcepub fn new(title: impl Into<String>) -> Self
pub fn new(title: impl Into<String>) -> Self
Create a toast with a title. Defaults: BadgeTone::Info, auto-dismiss
after DEFAULT_DURATION seconds.
Sourcepub fn description(self, description: impl Into<String>) -> Self
pub fn description(self, description: impl Into<String>) -> Self
Add a secondary line below the title.
Sourcepub fn duration(self, duration: Duration) -> Self
pub fn duration(self, duration: Duration) -> Self
Override how long the toast stays visible before it starts fading out.
Sourcepub fn persistent(self) -> Self
pub fn persistent(self) -> Self
Disable auto-dismiss. The toast stays until the user clicks × or
another toast pushes it out of the stack (see Toasts::max_visible).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Toast
impl RefUnwindSafe for Toast
impl Send for Toast
impl Sync for Toast
impl Unpin for Toast
impl UnsafeUnpin for Toast
impl UnwindSafe for Toast
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