Skip to main content

EuvToastProps

Struct EuvToastProps 

Source
pub struct EuvToastProps {
    pub variant: EuvToastVariant,
    pub title: &'static str,
    pub description: &'static str,
    pub action_label: &'static str,
    pub dismissible: bool,
    pub on_action: Option<Rc<dyn Fn()>>,
    pub on_close: Option<Rc<dyn Fn()>>,
}
Expand description

Props of the euv_toast component.

A toast is a short-lived card: it carries a title, a description, an optional action and an optional close button. The component is presentational — it renders what it is given and reports the clicks, so the caller keeps ownership of the queue and of the dismissal.

Fields§

§variant: EuvToastVariant

The visual variant of the toast.

§title: &'static str

The headline of the toast.

§description: &'static str

The body line of the toast.

§action_label: &'static str

The label of the action button.

§dismissible: bool

Whether the toast renders a close button.

§on_action: Option<Rc<dyn Fn()>>

The callback fired when the action button is clicked.

§on_close: Option<Rc<dyn Fn()>>

The callback fired when the close button is clicked.

Implementations§

Source§

impl EuvToastProps

Source

pub fn get_variant(&self) -> EuvToastVariant

Source

pub fn get_mut_variant(&mut self) -> &mut EuvToastVariant

Source

pub fn set_variant(&mut self, val: EuvToastVariant) -> &mut Self

Source

pub fn get_title(&self) -> &'static str

Source

pub fn get_mut_title(&mut self) -> &mut &'static str

Source

pub fn set_title(&mut self, val: &'static str) -> &mut Self

Source

pub fn get_description(&self) -> &'static str

Source

pub fn get_mut_description(&mut self) -> &mut &'static str

Source

pub fn set_description(&mut self, val: &'static str) -> &mut Self

Source

pub fn get_action_label(&self) -> &'static str

Source

pub fn get_mut_action_label(&mut self) -> &mut &'static str

Source

pub fn set_action_label(&mut self, val: &'static str) -> &mut Self

Source

pub fn get_dismissible(&self) -> bool

Source

pub fn get_mut_dismissible(&mut self) -> &mut bool

Source

pub fn set_dismissible(&mut self, val: bool) -> &mut Self

Source

pub fn get_on_action(&self) -> Rc<dyn Fn() + 'static>

Source

pub fn try_get_on_action(&self) -> &Option<Rc<dyn Fn() + 'static>>

Source

pub fn get_mut_on_action(&mut self) -> &mut Option<Rc<dyn Fn() + 'static>>

Source

pub fn set_on_action( &mut self, val: Option<Rc<dyn Fn() + 'static>>, ) -> &mut Self

Source

pub fn get_on_close(&self) -> Rc<dyn Fn() + 'static>

Source

pub fn try_get_on_close(&self) -> &Option<Rc<dyn Fn() + 'static>>

Source

pub fn get_mut_on_close(&mut self) -> &mut Option<Rc<dyn Fn() + 'static>>

Source

pub fn set_on_close(&mut self, val: Option<Rc<dyn Fn() + 'static>>) -> &mut Self

Source§

impl EuvToastProps

Source

pub fn new( variant: EuvToastVariant, title: &'static str, description: &'static str, action_label: &'static str, dismissible: bool, on_action: Option<Rc<dyn Fn()>>, on_close: Option<Rc<dyn Fn()>>, ) -> Self

Trait Implementations§

Source§

impl Clone for EuvToastProps

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for EuvToastProps

Source§

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

Formats the struct fields as a debug struct, skipping excluded fields.

§Arguments
  • &mut std::fmt::Formatter<'_> - The formatter to write the representation into.
§Returns
  • std::fmt::Result - Success or failure of the formatting operation.
Source§

impl Default for EuvToastProps

Source§

fn default() -> Self

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

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

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

impl<S, T> Upcast<T> for S
where T: UpcastFrom<S> + ?Sized, S: ?Sized,

Source§

fn upcast(&self) -> &T
where Self: ErasableGeneric, T: Sized + ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider ref type within the Wasm bindgen generics type system. Read more
Source§

fn upcast_into(self) -> T
where Self: Sized + ErasableGeneric, T: Sized + ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider type within the Wasm bindgen generics type system. Read more