pub struct ToastBuilder { /* private fields */ }Expand description
Builder for toast overlays
Implementations§
Source§impl ToastBuilder
impl ToastBuilder
Sourcepub fn duration_ms(self, ms: u32) -> ToastBuilder
pub fn duration_ms(self, ms: u32) -> ToastBuilder
Set auto-dismiss duration in milliseconds
Sourcepub fn corner(self, corner: Corner) -> ToastBuilder
pub fn corner(self, corner: Corner) -> ToastBuilder
Set corner position
Sourcepub fn content<F>(self, f: F) -> ToastBuilder
pub fn content<F>(self, f: F) -> ToastBuilder
Set the content using a builder function
Sourcepub fn motion_key(self, key: impl Into<String>) -> ToastBuilder
pub fn motion_key(self, key: impl Into<String>) -> ToastBuilder
Set the motion key for triggering content exit animations
When the overlay transitions to Closing state, it will automatically
trigger exit animation on the motion with this key. Use the same key
with motion_derived(key) in your content builder.
Sourcepub fn show(self) -> OverlayHandle
pub fn show(self) -> OverlayHandle
Show the toast
Auto Trait Implementations§
impl Freeze for ToastBuilder
impl !RefUnwindSafe for ToastBuilder
impl Send for ToastBuilder
impl Sync for ToastBuilder
impl Unpin for ToastBuilder
impl UnsafeUnpin for ToastBuilder
impl !UnwindSafe for ToastBuilder
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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.