pub struct ToastState {
pub messages: Vec<ToastMessage>,
}Expand description
State for toast notification display.
Add messages with ToastState::info, ToastState::success,
ToastState::warning, or ToastState::error, then pass the state to
Context::toast each frame. Expired messages are removed automatically.
Fields§
§messages: Vec<ToastMessage>Active toast messages, ordered oldest-first.
Implementations§
Source§impl ToastState
impl ToastState
Sourcepub fn info(&mut self, text: impl Into<String>, tick: u64)
pub fn info(&mut self, text: impl Into<String>, tick: u64)
Push an informational toast visible for 30 ticks.
Sourcepub fn success(&mut self, text: impl Into<String>, tick: u64)
pub fn success(&mut self, text: impl Into<String>, tick: u64)
Push a success toast visible for 30 ticks.
Sourcepub fn warning(&mut self, text: impl Into<String>, tick: u64)
pub fn warning(&mut self, text: impl Into<String>, tick: u64)
Push a warning toast visible for 50 ticks.
Sourcepub fn error(&mut self, text: impl Into<String>, tick: u64)
pub fn error(&mut self, text: impl Into<String>, tick: u64)
Push an error toast visible for 80 ticks.
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
Auto Trait Implementations§
impl Freeze for ToastState
impl RefUnwindSafe for ToastState
impl Send for ToastState
impl Sync for ToastState
impl Unpin for ToastState
impl UnsafeUnpin 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