pub enum ToastEntranceAnimation {
SlideFromTop,
SlideFromRight,
SlideFromBottom,
SlideFromLeft,
FadeIn,
None,
}Expand description
Entrance animation type.
Determines how the toast appears on screen.
Variants§
SlideFromTop
Slide in from the top edge.
SlideFromRight
Slide in from the right edge.
SlideFromBottom
Slide in from the bottom edge.
SlideFromLeft
Slide in from the left edge.
FadeIn
Fade in (opacity transition).
None
No animation (instant appear).
Implementations§
Source§impl ToastEntranceAnimation
impl ToastEntranceAnimation
Sourcepub fn initial_offset(self, toast_width: u16, toast_height: u16) -> (i16, i16)
pub fn initial_offset(self, toast_width: u16, toast_height: u16) -> (i16, i16)
Get the initial offset for this entrance animation.
Returns (dx, dy) offset in cells from the final position.
Sourcepub fn offset_at_progress(
self,
progress: f64,
toast_width: u16,
toast_height: u16,
) -> (i16, i16)
pub fn offset_at_progress( self, progress: f64, toast_width: u16, toast_height: u16, ) -> (i16, i16)
Calculate the offset at a given progress (0.0 to 1.0).
Progress of 0.0 = initial offset, 1.0 = no 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 ToastEntranceAnimation
impl Clone for ToastEntranceAnimation
Source§fn clone(&self) -> ToastEntranceAnimation
fn clone(&self) -> ToastEntranceAnimation
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 ToastEntranceAnimation
impl Debug for ToastEntranceAnimation
Source§impl Default for ToastEntranceAnimation
impl Default for ToastEntranceAnimation
Source§fn default() -> ToastEntranceAnimation
fn default() -> ToastEntranceAnimation
Returns the “default value” for a type. Read more
Source§impl PartialEq for ToastEntranceAnimation
impl PartialEq for ToastEntranceAnimation
impl Copy for ToastEntranceAnimation
impl Eq for ToastEntranceAnimation
impl StructuralPartialEq for ToastEntranceAnimation
Auto Trait Implementations§
impl Freeze for ToastEntranceAnimation
impl RefUnwindSafe for ToastEntranceAnimation
impl Send for ToastEntranceAnimation
impl Sync for ToastEntranceAnimation
impl Unpin for ToastEntranceAnimation
impl UnwindSafe for ToastEntranceAnimation
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.