pub struct Transition {
pub duration_ms: f32,
pub easing: Easing,
pub repeat: Repeat,
pub bounce: Option<Bounce>,
pub delay_ms: f32,
}Expand description
How a node’s animatable values move when the view changes them: a
duration, an easing (a timed curve or a spring), and for keyframes a
repeat direction and a delay. Built with Transition::ms and the
builders, or through the NodeSpec shorthands (transition, easing,
bounce, repeat, delay).
Fields§
§duration_ms: f32How long a timed curve takes; for a spring, its response time — about how long it takes to get there.
easing: Easing§repeat: RepeatHow the node’s keyframes cycle (nothing without keyframes).
bounce: Option<Bounce>A spring’s bounce in place of its easing’s own; on a timed curve
it makes the transition a spring (Self::curve). None is the
easing’s.
delay_ms: f32Holds the keyframe cycle back by this many ms, so siblings given
different delays run out of phase (CSS’s animation-delay).
Implementations§
Source§impl Transition
impl Transition
Sourcepub fn ms(duration_ms: f32) -> Transition
pub fn ms(duration_ms: f32) -> Transition
A cubic ease-out over duration_ms.
Sourcepub fn easing(self, easing: Easing) -> Transition
pub fn easing(self, easing: Easing) -> Transition
The curve or spring to move by.
Sourcepub fn repeat(self, repeat: Repeat) -> Transition
pub fn repeat(self, repeat: Repeat) -> Transition
How keyframes cycle (CSS’s animation-direction).
Sourcepub fn delay(self, delay_ms: f32) -> Transition
pub fn delay(self, delay_ms: f32) -> Transition
Holds a keyframe cycle back by delay_ms (CSS’s animation-delay).
Sourcepub fn bounce(self, bounce: f32) -> Transition
pub fn bounce(self, bounce: f32) -> Transition
Springs with this bounce, 0 (no overshoot) to MAX_BOUNCE: on a
spring easing in place of its own, and on a timed one in place of
the curve, since a bounce is only a spring’s to have.
Sourcepub fn curve(&self) -> Easing
pub fn curve(&self) -> Easing
The easing this transition moves by: its easing, or
Easing::Spring when a bounce was given to a timed curve.
Trait Implementations§
Source§impl Clone for Transition
impl Clone for Transition
Source§fn clone(&self) -> Transition
fn clone(&self) -> Transition
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for Transition
Source§impl Debug for Transition
impl Debug for Transition
Source§impl PartialEq for Transition
impl PartialEq for Transition
impl StructuralPartialEq for Transition
Auto Trait Implementations§
impl Freeze for Transition
impl RefUnwindSafe for Transition
impl Send for Transition
impl Sync for Transition
impl Unpin for Transition
impl UnsafeUnpin for Transition
impl UnwindSafe for Transition
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<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>
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>
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)
&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)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.