pub struct ToastLayer { /* private fields */ }Expand description
The stack of notifications for one window.
The host mounts one of these where it wants toasts drawn; mounting is also
what makes push deliverable.
Implementations§
Source§impl ToastLayer
impl ToastLayer
Sourcepub fn new(cx: &mut Context<'_, Self>) -> Self
pub fn new(cx: &mut Context<'_, Self>) -> Self
Mounts a layer and makes it the one push delivers to.
A second layer takes over from the first, so an application with two windows decides which one notifies by mounting there last.
pub fn corner(self, corner: ToastCorner) -> Self
Sourcepub fn capacity(self, capacity: usize) -> Self
pub fn capacity(self, capacity: usize) -> Self
How many toasts stand at once. A capacity below one is raised to one.
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Sourcepub fn phase(&self, ident: &str) -> Option<Phase>
pub fn phase(&self, ident: &str) -> Option<Phase>
The lifecycle phase of one toast, or None when it is not in the tree.
Sourcepub fn push(&mut self, toast: Toast, cx: &mut Context<'_, Self>)
pub fn push(&mut self, toast: Toast, cx: &mut Context<'_, Self>)
Adds a toast, or refreshes the one that already carries this identity.
Sourcepub fn dismiss(&mut self, ident: &str, cx: &mut Context<'_, Self>) -> bool
pub fn dismiss(&mut self, ident: &str, cx: &mut Context<'_, Self>) -> bool
Starts the exit of one toast. The element stays in the tree until the exit finishes.
pub fn clear(&mut self, cx: &mut Context<'_, Self>)
Trait Implementations§
Source§impl Debug for ToastLayer
impl Debug for ToastLayer
Source§impl Render for ToastLayer
impl Render for ToastLayer
Auto Trait Implementations§
impl !RefUnwindSafe for ToastLayer
impl !Send for ToastLayer
impl !Sync for ToastLayer
impl !UnwindSafe for ToastLayer
impl Freeze for ToastLayer
impl Unpin for ToastLayer
impl UnsafeUnpin for ToastLayer
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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