Struct egui_notify::Toasts
source · [−]pub struct Toasts { /* private fields */ }Expand description
Implementations
sourceimpl Toasts
impl Toasts
sourcepub fn add(&mut self, toast: Toast) -> &mut Toast
pub fn add(&mut self, toast: Toast) -> &mut Toast
Adds new toast to the collection.
By default adds toast at the end of the list, can be changed with self.reverse.
sourcepub fn dismiss_oldest_toast(&mut self)
pub fn dismiss_oldest_toast(&mut self)
Dismisses the oldest toast
sourcepub fn dismiss_latest_toast(&mut self)
pub fn dismiss_latest_toast(&mut self)
Dismisses the most recent toast
sourcepub fn dismiss_all_toasts(&mut self)
pub fn dismiss_all_toasts(&mut self)
Dismisses all toasts
sourcepub fn success(&mut self, caption: impl Into<String>) -> &mut Toast
pub fn success(&mut self, caption: impl Into<String>) -> &mut Toast
Shortcut for adding a toast with info success.
sourcepub fn info(&mut self, caption: impl Into<String>) -> &mut Toast
pub fn info(&mut self, caption: impl Into<String>) -> &mut Toast
Shortcut for adding a toast with info level.
sourcepub fn warning(&mut self, caption: impl Into<String>) -> &mut Toast
pub fn warning(&mut self, caption: impl Into<String>) -> &mut Toast
Shortcut for adding a toast with warning level.
sourcepub fn error(&mut self, caption: impl Into<String>) -> &mut Toast
pub fn error(&mut self, caption: impl Into<String>) -> &mut Toast
Shortcut for adding a toast with error level.
sourcepub fn basic(&mut self, caption: impl Into<String>) -> &mut Toast
pub fn basic(&mut self, caption: impl Into<String>) -> &mut Toast
Shortcut for adding a toast with no level.
sourcepub const fn with_anchor(self, anchor: Anchor) -> Self
pub const fn with_anchor(self, anchor: Anchor) -> Self
Where toasts should appear.
sourcepub const fn with_spacing(self, spacing: f32) -> Self
pub const fn with_spacing(self, spacing: f32) -> Self
Sets spacing between adjacent toasts.
sourcepub const fn with_margin(self, margin: Vec2) -> Self
pub const fn with_margin(self, margin: Vec2) -> Self
Margin or distance from screen to toasts’ bounding boxes
sourcepub const fn with_padding(self, padding: Vec2) -> Self
pub const fn with_padding(self, padding: Vec2) -> Self
Padding or distance from toasts’ bounding boxes to inner contents.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Toasts
impl Send for Toasts
impl Sync for Toasts
impl Unpin for Toasts
impl UnwindSafe for Toasts
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more