pub struct ToastManager<I, T> { /* private fields */ }Expand description
Ordered toast storage, lifecycle, auto-hide, limits, and exit coordination.
Implementations§
Source§impl<I, T> ToastManager<I, T>
impl<I, T> ToastManager<I, T>
Sourcepub fn new(motion: ToastMotion) -> Self
pub fn new(motion: ToastMotion) -> Self
Create a manager using the supplied motion duration for enter and exit.
Sourcepub fn iter(
&self,
) -> impl DoubleEndedIterator<Item = (&I, &T, ToastTransitionStatus)>
pub fn iter( &self, ) -> impl DoubleEndedIterator<Item = (&I, &T, ToastTransitionStatus)>
Iterate over mounted toast ids, values, and phases in display order.
Source§impl<I: Clone + Eq, T> ToastManager<I, T>
impl<I: Clone + Eq, T> ToastManager<I, T>
Sourcepub fn push(
&mut self,
id: I,
value: T,
options: ToastOptions,
now: Instant,
) -> Option<T>
pub fn push( &mut self, id: I, value: T, options: ToastOptions, now: Instant, ) -> Option<T>
Add a newest toast, replacing an existing toast with the same id.
Sourcepub fn dismiss(&mut self, id: &I, now: Instant) -> bool
pub fn dismiss(&mut self, id: &I, now: Instant) -> bool
Begin a toast’s exit transition, returning whether its state changed.
Sourcepub fn dismiss_all(&mut self, now: Instant) -> Vec<I>
pub fn dismiss_all(&mut self, now: Instant) -> Vec<I>
Begin the exit transition for every active toast.
Sourcepub fn advance(&mut self, now: Instant, paused: bool) -> ToastAdvance<I, T>
pub fn advance(&mut self, now: Instant, paused: bool) -> ToastAdvance<I, T>
Advance lifecycle time; active timers pause while paused is true.
Trait Implementations§
Auto Trait Implementations§
impl<I, T> Freeze for ToastManager<I, T>
impl<I, T> RefUnwindSafe for ToastManager<I, T>where
VecDeque<ManagedToast<I, T>>: RefUnwindSafe,
impl<I, T> Send for ToastManager<I, T>
impl<I, T> Sync for ToastManager<I, T>
impl<I, T> Unpin for ToastManager<I, T>
impl<I, T> UnsafeUnpin for ToastManager<I, T>where
VecDeque<ManagedToast<I, T>>: UnsafeUnpin,
impl<I, T> UnwindSafe for ToastManager<I, T>where
VecDeque<ManagedToast<I, T>>: UnwindSafe,
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more