pub enum Easing {
EaseOut,
Linear,
EaseIn,
EaseInOut,
Spring,
Bouncy,
Smooth,
Snappy,
}Expand description
Easing curve for a Transition.
Variants§
EaseOut
Cubic ease-out: fast start, gentle landing (the UI default).
Linear
EaseIn
EaseInOut
Spring
A spring with a hint of overshoot (bounce 0.25). duration_ms is
how long it takes to get there; velocity carries across retargets.
Bouncy
A spring that visibly bounces (bounce 0.5).
Smooth
A spring that glides in without overshooting (bounce 0): an ease-out that keeps its momentum when retargeted.
Snappy
A quick spring with a trace of overshoot (bounce 0.15).
Implementations§
Source§impl Easing
impl Easing
Sourcepub const ALL: &'static [Easing]
pub const ALL: &'static [Easing]
Every curve, in wire order: schema::EASINGS is ALL by name,
and a binding sends the index.
Sourcepub fn from_index(i: usize) -> Easing
pub fn from_index(i: usize) -> Easing
The variant schema::EASINGS index i names; the default for an
index this build lacks.
Sourcepub fn bounce(self) -> Option<f32>
pub fn bounce(self) -> Option<f32>
The bounce a spring easing has unless Transition::bounce says
otherwise; None for the timed curves.
Sourcepub fn is_spring(self) -> bool
pub fn is_spring(self) -> bool
Whether this is a spring, integrated with momentum, rather than a timed curve.
pub fn apply(self, t: f32) -> f32
Trait Implementations§
impl Copy for Easing
impl Eq for Easing
impl StructuralPartialEq for Easing
Auto Trait Implementations§
impl Freeze for Easing
impl RefUnwindSafe for Easing
impl Send for Easing
impl Sync for Easing
impl Unpin for Easing
impl UnsafeUnpin for Easing
impl UnwindSafe for Easing
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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§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
key and return true if they are equal.