Struct egui_toast::Toasts

source ·
pub struct Toasts { /* private fields */ }

Implementations§

source§

impl Toasts

source

pub fn new() -> Self

source

pub fn position(self, position: impl Into<Pos2>) -> Self

Position where the toasts show up.

The toasts will start from this position and stack up in the direction specified with Self::direction.

source

pub fn anchor(self, anchor: Align2, offset: impl Into<Pos2>) -> Self

Anchor for the toasts.

For instance, if you set this to (10.0, 10.0) and Align2::LEFT_TOP, then (10.0, 10.0) will be the top-left corner of the first toast.

source

pub fn direction(self, direction: impl Into<Direction>) -> Self

Direction where the toasts stack up

source

pub fn custom_contents( self, kind: impl Into<ToastKind>, add_contents: impl Fn(&mut Ui, &mut Toast) -> Response + Send + Sync + 'static ) -> Self

Can be used to specify a custom rendering function for toasts for given kind

source

pub fn add(&mut self, toast: Toast) -> &mut Self

Add a new toast

source

pub fn show(&mut self, ctx: &Context)

Show and update all toasts

Trait Implementations§

source§

impl Default for Toasts

source§

fn default() -> Self

Returns the “default value” for a type. Read more

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