Struct egui_notify::Toast

source ·
pub struct Toast { /* private fields */ }
Expand description

Single notification or toast

Implementations§

source§

impl Toast

source

pub fn basic(caption: impl Into<String>) -> Self

Creates new basic toast, can be closed by default.

source

pub fn success(caption: impl Into<String>) -> Self

Creates new success toast, can be closed by default.

source

pub fn info(caption: impl Into<String>) -> Self

Creates new info toast, can be closed by default.

source

pub fn warning(caption: impl Into<String>) -> Self

Creates new warning toast, can be closed by default.

source

pub fn error(caption: impl Into<String>) -> Self

Creates new error toast, can not be closed by default.

source

pub fn custom(caption: impl Into<String>, level: ToastLevel) -> Self

Creates new custom toast, can be closed by default.

source

pub fn set_options(&mut self, options: ToastOptions) -> &mut Self

Set the options with a ToastOptions

source

pub fn set_level(&mut self, level: ToastLevel) -> &mut Self

Change the level of the toast

source

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].

source

pub fn set_closable(&mut self, closable: bool) -> &mut Self

Can use close the toast?

source

pub fn set_show_progress_bar(&mut self, show_progress_bar: bool) -> &mut Self

Should a progress bar be shown?

source

pub fn set_duration(&mut self, duration: Option<Duration>) -> &mut Self

In what time should the toast expire? Set to None for no expiry.

source

pub fn set_height(&mut self, height: f32) -> &mut Self

Toast’s box height

source

pub fn set_width(&mut self, width: f32) -> &mut Self

Toast’s box width

source

pub fn dismiss(&mut self)

Dismiss this toast

Trait Implementations§

source§

impl Debug for Toast

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

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> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.