pub struct ToastExtras { /* private fields */ }Expand description
What a toast can do besides showing: a button, something to run once it is gone, and a place of its own.
Implementations§
Source§impl ToastExtras
impl ToastExtras
Sourcepub fn new() -> ToastExtras
pub fn new() -> ToastExtras
Nothing besides showing.
Sourcepub fn action(
self,
label: impl Into<String>,
run: impl Fn() + 'static,
) -> ToastExtras
pub fn action( self, label: impl Into<String>, run: impl Fn() + 'static, ) -> ToastExtras
A button on the toast. Pressing it runs this and closes the toast.
Sourcepub fn on_close(self, run: impl Fn() + 'static) -> ToastExtras
pub fn on_close(self, run: impl Fn() + 'static) -> ToastExtras
Runs this once the toast is gone, by itself or closed by a person.
Sourcepub fn position(self, position: ToastPosition) -> ToastExtras
pub fn position(self, position: ToastPosition) -> ToastExtras
Shows this toast here instead of where its Toaster puts the others.
Trait Implementations§
Source§impl Clone for ToastExtras
impl Clone for ToastExtras
Source§fn clone(&self) -> ToastExtras
fn clone(&self) -> ToastExtras
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ToastExtras
impl Debug for ToastExtras
Source§impl Default for ToastExtras
impl Default for ToastExtras
Source§fn default() -> ToastExtras
fn default() -> ToastExtras
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for ToastExtras
impl !Send for ToastExtras
impl !Sync for ToastExtras
impl !UnwindSafe for ToastExtras
impl Freeze for ToastExtras
impl Unpin for ToastExtras
impl UnsafeUnpin for ToastExtras
Blanket Implementations§
impl<T> AutoreleaseSafe for Twhere
T: ?Sized,
impl<T> AutoreleaseSafe for Twhere
T: ?Sized,
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