Struct egui_notify::Toast
source · pub struct Toast { /* private fields */ }
Expand description
Single notification or toast
Implementations§
source§impl Toast
impl Toast
sourcepub fn basic(caption: impl Into<String>) -> Self
pub fn basic(caption: impl Into<String>) -> Self
Creates new basic toast, can be closed by default.
sourcepub fn success(caption: impl Into<String>) -> Self
pub fn success(caption: impl Into<String>) -> Self
Creates new success toast, can be closed by default.
sourcepub fn info(caption: impl Into<String>) -> Self
pub fn info(caption: impl Into<String>) -> Self
Creates new info toast, can be closed by default.
sourcepub fn warning(caption: impl Into<String>) -> Self
pub fn warning(caption: impl Into<String>) -> Self
Creates new warning toast, can be closed by default.
sourcepub fn error(caption: impl Into<String>) -> Self
pub fn error(caption: impl Into<String>) -> Self
Creates new error toast, can not be closed by default.
sourcepub fn custom(caption: impl Into<String>, level: ToastLevel) -> Self
pub fn custom(caption: impl Into<String>, level: ToastLevel) -> Self
Creates new custom toast, can be closed by default.
sourcepub fn set_options(&mut self, options: ToastOptions) -> &mut Self
pub fn set_options(&mut self, options: ToastOptions) -> &mut Self
Set the options with a ToastOptions
sourcepub fn set_level(&mut self, level: ToastLevel) -> &mut Self
pub fn set_level(&mut self, level: ToastLevel) -> &mut Self
Change the level of the toast
sourcepub fn set_font(&mut self, font: FontId) -> &mut Self
pub fn set_font(&mut self, font: FontId) -> &mut Self
Changes the font used to draw the caption, it takes precedence over the value from
[Toasts
].
sourcepub fn set_closable(&mut self, closable: bool) -> &mut Self
pub fn set_closable(&mut self, closable: bool) -> &mut Self
Can use close the toast?
sourcepub fn set_show_progress_bar(&mut self, show_progress_bar: bool) -> &mut Self
pub fn set_show_progress_bar(&mut self, show_progress_bar: bool) -> &mut Self
Should a progress bar be shown?
sourcepub fn set_duration(&mut self, duration: Option<Duration>) -> &mut Self
pub fn set_duration(&mut self, duration: Option<Duration>) -> &mut Self
In what time should the toast expire? Set to None
for no expiry.
sourcepub fn set_height(&mut self, height: f32) -> &mut Self
pub fn set_height(&mut self, height: f32) -> &mut Self
Toast’s box height
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Toast
impl RefUnwindSafe for Toast
impl Send for Toast
impl Sync for Toast
impl Unpin for Toast
impl UnwindSafe for Toast
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