Struct egui_notify::Toasts
source · pub struct Toasts { /* private fields */ }
Expand description
Implementations§
source§impl 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 fn custom(
&mut self,
caption: impl Into<String>,
level_string: String,
level_color: Color32
) -> &mut Toast
pub fn custom( &mut self, caption: impl Into<String>, level_string: String, level_color: Color32 ) -> &mut Toast
Shortcut for adding a toast with custom 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.
sourcepub fn with_default_font(self, font: FontId) -> Self
pub fn with_default_font(self, font: FontId) -> Self
Changes the default font used for all toasts.
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 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