pub struct MotionTrack {
pub property: MotionPropertyId,
pub phase: MotionPhase,
pub from: MotionStartValue,
pub to: MotionExpr,
pub transition: MotionTransition,
}Expand description
A single declarative animation from a start value to a target expression.
Tracks are grouped by Motion or Presence and synchronized into the
runtime. Later tracks targeting the same property and phase win when widget
presets are composed.
ⓘ
use fission::motion::{
px, MotionPropertyId, MotionStartValue, MotionTrack, MotionTransition, MotionEasing,
};
let slide = MotionTrack::composite(
MotionPropertyId::TranslateY,
MotionStartValue::Explicit(px(16.0)),
px(0.0),
)
.transition(MotionTransition::tween(160, MotionEasing::EaseOut));Fields§
§property: MotionPropertyIdProperty affected by this track.
phase: MotionPhaseRendering phase affected by this track.
from: MotionStartValueSource value for a newly synchronized target.
to: MotionExprTarget expression evaluated by the runtime.
transition: MotionTransitionTiming model for this track.
Implementations§
Source§impl MotionTrack
impl MotionTrack
Sourcepub fn composite(
property: MotionPropertyId,
from: MotionStartValue,
to: MotionExpr,
) -> Self
pub fn composite( property: MotionPropertyId, from: MotionStartValue, to: MotionExpr, ) -> Self
Creates a compositor-phase track for transform or opacity properties.
Sourcepub fn transition(self, transition: MotionTransition) -> Self
pub fn transition(self, transition: MotionTransition) -> Self
Replaces the track’s timing model.
Trait Implementations§
Source§impl Clone for MotionTrack
impl Clone for MotionTrack
Source§fn clone(&self) -> MotionTrack
fn clone(&self) -> MotionTrack
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 MotionTrack
impl Debug for MotionTrack
Source§impl<'de> Deserialize<'de> for MotionTrack
impl<'de> Deserialize<'de> for MotionTrack
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for MotionTrack
impl PartialEq for MotionTrack
Source§fn eq(&self, other: &MotionTrack) -> bool
fn eq(&self, other: &MotionTrack) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for MotionTrack
impl Serialize for MotionTrack
impl StructuralPartialEq for MotionTrack
Auto Trait Implementations§
impl Freeze for MotionTrack
impl RefUnwindSafe for MotionTrack
impl Send for MotionTrack
impl Sync for MotionTrack
impl Unpin for MotionTrack
impl UnsafeUnpin for MotionTrack
impl UnwindSafe for MotionTrack
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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.