pub struct ToastManager { /* private fields */ }Expand description
Toast notification manager
Implementations§
Source§impl ToastManager
impl ToastManager
Sourcepub const fn position(self, position: ToastPosition) -> Self
pub const fn position(self, position: ToastPosition) -> Self
Set the position where toasts appear
Sourcepub const fn max_toasts(self, max: usize) -> Self
pub const fn max_toasts(self, max: usize) -> Self
Set the maximum number of toasts to show at once
Sourcepub fn add(
&mut self,
message: impl Into<String>,
variant: ToastVariant,
current_time: f64,
) -> ToastId
pub fn add( &mut self, message: impl Into<String>, variant: ToastVariant, current_time: f64, ) -> ToastId
Add a new toast notification, returning its ID for later updates.
Sourcepub fn set_progress(&mut self, id: ToastId, progress: f32)
pub fn set_progress(&mut self, id: ToastId, progress: f32)
Update the progress bar of a toast (0.0..=1.0). While external progress is set the toast will not auto-dismiss.
Sourcepub fn set_message(&mut self, id: ToastId, message: impl Into<String>)
pub fn set_message(&mut self, id: ToastId, message: impl Into<String>)
Update the message text of an existing toast.
Sourcepub fn set_title(&mut self, id: ToastId, title: impl Into<String>)
pub fn set_title(&mut self, id: ToastId, title: impl Into<String>)
Update the title of an existing toast.
Sourcepub fn set_variant(&mut self, id: ToastId, variant: ToastVariant)
pub fn set_variant(&mut self, id: ToastId, variant: ToastVariant)
Update the variant of an existing toast.
Sourcepub fn start_dismiss(&mut self, id: ToastId, current_time: f64)
pub fn start_dismiss(&mut self, id: ToastId, current_time: f64)
Remove external progress and start the auto-dismiss countdown from now. Useful after a task completes to show a brief “done” message before fading.
Sourcepub const fn custom(&mut self) -> ToastBuilder<'_>
pub const fn custom(&mut self) -> ToastBuilder<'_>
Add a custom toast with builder pattern
Trait Implementations§
Source§impl Clone for ToastManager
impl Clone for ToastManager
Source§fn clone(&self) -> ToastManager
fn clone(&self) -> ToastManager
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 moreAuto Trait Implementations§
impl Freeze for ToastManager
impl RefUnwindSafe for ToastManager
impl Send for ToastManager
impl Sync for ToastManager
impl Unpin for ToastManager
impl UnsafeUnpin for ToastManager
impl UnwindSafe for ToastManager
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