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§
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