pub struct ToastEntry {
pub id: Option<String>,
pub message: String,
pub level: ToastLevel,
pub priority: ToastPriority,
pub duration: Option<Duration>,
pub created_at: Instant,
pub shown_at: Option<Instant>,
pub dismissible: bool,
}Expand description
A toast entry in the queue
Fields§
§id: Option<String>Unique ID for deduplication
message: StringToast message
level: ToastLevelToast level
priority: ToastPriorityPriority
duration: Option<Duration>Duration to show (None = use default)
created_at: InstantTime when toast was created
shown_at: Option<Instant>Time when toast was shown
dismissible: boolWhether toast is dismissible
Implementations§
Source§impl ToastEntry
impl ToastEntry
Sourcepub fn new(message: impl Into<String>, level: ToastLevel) -> Self
pub fn new(message: impl Into<String>, level: ToastLevel) -> Self
Create a new toast entry
Sourcepub fn with_priority(self, priority: ToastPriority) -> Self
pub fn with_priority(self, priority: ToastPriority) -> Self
Set the priority
Sourcepub fn with_duration(self, duration: Duration) -> Self
pub fn with_duration(self, duration: Duration) -> Self
Set custom duration
Sourcepub fn dismissible(self, dismissible: bool) -> Self
pub fn dismissible(self, dismissible: bool) -> Self
Set whether dismissible
Trait Implementations§
Source§impl Clone for ToastEntry
impl Clone for ToastEntry
Source§fn clone(&self) -> ToastEntry
fn clone(&self) -> ToastEntry
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 ToastEntry
impl RefUnwindSafe for ToastEntry
impl Send for ToastEntry
impl Sync for ToastEntry
impl Unpin for ToastEntry
impl UnsafeUnpin for ToastEntry
impl UnwindSafe for ToastEntry
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