pub enum ToastExitAnimation {
FadeOut,
SlideOut,
SlideToTop,
SlideToRight,
SlideToBottom,
SlideToLeft,
None,
}Expand description
Exit animation type.
Determines how the toast disappears from screen.
Variants§
FadeOut
Fade out (opacity transition).
SlideOut
Slide out in the reverse of entrance direction.
SlideToTop
Slide out to the specified edge.
SlideToRight
SlideToBottom
SlideToLeft
None
No animation (instant disappear).
Implementations§
Source§impl ToastExitAnimation
impl ToastExitAnimation
Sourcepub fn final_offset(
self,
toast_width: u16,
toast_height: u16,
entrance: ToastEntranceAnimation,
) -> (i16, i16)
pub fn final_offset( self, toast_width: u16, toast_height: u16, entrance: ToastEntranceAnimation, ) -> (i16, i16)
Get the final offset for this exit animation.
Returns (dx, dy) offset in cells from the starting position.
Sourcepub fn offset_at_progress(
self,
progress: f64,
toast_width: u16,
toast_height: u16,
entrance: ToastEntranceAnimation,
) -> (i16, i16)
pub fn offset_at_progress( self, progress: f64, toast_width: u16, toast_height: u16, entrance: ToastEntranceAnimation, ) -> (i16, i16)
Calculate the offset at a given progress (0.0 to 1.0).
Progress of 0.0 = no offset, 1.0 = final offset.
Sourcepub fn affects_position(self) -> bool
pub fn affects_position(self) -> bool
Check if this animation affects position (vs. just opacity).
Trait Implementations§
Source§impl Clone for ToastExitAnimation
impl Clone for ToastExitAnimation
Source§fn clone(&self) -> ToastExitAnimation
fn clone(&self) -> ToastExitAnimation
Returns a duplicate of the value. Read more
1.0.0 · 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 ToastExitAnimation
impl Debug for ToastExitAnimation
Source§impl Default for ToastExitAnimation
impl Default for ToastExitAnimation
Source§fn default() -> ToastExitAnimation
fn default() -> ToastExitAnimation
Returns the “default value” for a type. Read more
Source§impl PartialEq for ToastExitAnimation
impl PartialEq for ToastExitAnimation
impl Copy for ToastExitAnimation
impl Eq for ToastExitAnimation
impl StructuralPartialEq for ToastExitAnimation
Auto Trait Implementations§
impl Freeze for ToastExitAnimation
impl RefUnwindSafe for ToastExitAnimation
impl Send for ToastExitAnimation
impl Sync for ToastExitAnimation
impl Unpin for ToastExitAnimation
impl UnwindSafe for ToastExitAnimation
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.