pub struct ToastState {
pub created_at: Instant,
pub dismissed: bool,
pub animation: ToastAnimationState,
pub focused_action: Option<usize>,
pub timer_paused: bool,
pub pause_started: Option<Instant>,
pub total_paused: Duration,
}Expand description
Internal state tracking for a toast.
Fields§
§created_at: InstantWhen the toast was created.
dismissed: boolWhether the toast has been dismissed.
animation: ToastAnimationStateAnimation state.
focused_action: Option<usize>Index of the currently focused action, if any.
timer_paused: boolWhether the auto-dismiss timer is paused (e.g., due to action focus).
pause_started: Option<Instant>When the timer was paused, for calculating credited time.
total_paused: DurationTotal duration the timer has been paused (accumulated across multiple pauses).
Implementations§
Source§impl ToastState
impl ToastState
Sourcepub fn with_reduced_motion() -> Self
pub fn with_reduced_motion() -> Self
Create a new state with reduced motion enabled.
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