pub struct MotionSpec { /* private fields */ }Expand description
A renderer-neutral transition specification.
Implementations§
Source§impl MotionSpec
impl MotionSpec
Sourcepub const fn new(
preference: MotionPreference,
duration: MotionDuration,
easing: MotionEasing,
) -> Self
pub const fn new( preference: MotionPreference, duration: MotionDuration, easing: MotionEasing, ) -> Self
Creates a motion spec from preference, duration, and easing.
Sourcepub const fn layout(preference: MotionPreference) -> Self
pub const fn layout(preference: MotionPreference) -> Self
Creates the default layout motion spec for the given preference.
Sourcepub const fn affordance(preference: MotionPreference) -> Self
pub const fn affordance(preference: MotionPreference) -> Self
Creates short affordance motion for hover feedback, guides, and lightweight overlays.
Sourcepub const fn committed_layout(preference: MotionPreference) -> Self
pub const fn committed_layout(preference: MotionPreference) -> Self
Creates committed layout motion for insert, remove, collapse, and expand transitions.
Sourcepub const fn continuity(preference: MotionPreference) -> Self
pub const fn continuity(preference: MotionPreference) -> Self
Creates continuity motion for zoom, unzoom, and retargeted transitions.
Sourcepub const fn preference(self) -> MotionPreference
pub const fn preference(self) -> MotionPreference
Returns the motion preference.
Sourcepub const fn duration(self) -> MotionDuration
pub const fn duration(self) -> MotionDuration
Returns the duration token.
Sourcepub const fn easing(self) -> MotionEasing
pub const fn easing(self) -> MotionEasing
Returns the easing token.
Sourcepub const fn is_immediate(self) -> bool
pub const fn is_immediate(self) -> bool
Returns whether this spec completes immediately.
Sourcepub const fn allows_spatial_motion(self) -> bool
pub const fn allows_spatial_motion(self) -> bool
Returns whether this spec allows spatial movement.
Sourcepub fn progress_at(self, elapsed: Duration) -> f32
pub fn progress_at(self, elapsed: Duration) -> f32
Samples this motion spec’s eased progress for the elapsed duration.
Trait Implementations§
Source§impl Clone for MotionSpec
impl Clone for MotionSpec
impl Copy for MotionSpec
Source§impl Debug for MotionSpec
impl Debug for MotionSpec
impl Eq for MotionSpec
Source§impl PartialEq for MotionSpec
impl PartialEq for MotionSpec
impl StructuralPartialEq for MotionSpec
Auto Trait Implementations§
impl Freeze for MotionSpec
impl RefUnwindSafe for MotionSpec
impl Send for MotionSpec
impl Sync for MotionSpec
impl Unpin for MotionSpec
impl UnsafeUnpin for MotionSpec
impl UnwindSafe for MotionSpec
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