pub struct Toasts { /* private fields */ }Expand description
Renderer for the enqueued toast stack.
Configure placement via the builder, then call Toasts::render once
per frame. Multiple Toasts::render calls per frame are a mistake —
each one will paint the whole stack.
Implementations§
Source§impl Toasts
impl Toasts
Sourcepub fn new() -> Self
pub fn new() -> Self
Start a new configuration. Defaults: anchored to the bottom-right with a 12-pt offset, up to 5 toasts visible, 320-pt wide.
Sourcepub fn anchor(self, anchor: Align2) -> Self
pub fn anchor(self, anchor: Align2) -> Self
Anchor corner for the stack. Default: Align2::RIGHT_BOTTOM.
Sourcepub fn offset(self, offset: impl Into<Vec2>) -> Self
pub fn offset(self, offset: impl Into<Vec2>) -> Self
Offset from the anchor corner, in points. Default: (12, 12).
Sourcepub fn max_visible(self, max_visible: usize) -> Self
pub fn max_visible(self, max_visible: usize) -> Self
Maximum number of toasts rendered at once. Oldest are dropped when the cap is exceeded. Default: 5.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Toasts
impl RefUnwindSafe for Toasts
impl Send for Toasts
impl Sync for Toasts
impl Unpin for Toasts
impl UnsafeUnpin for Toasts
impl UnwindSafe for Toasts
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