pub struct MotionTimeline { /* private fields */ }Expand description
A deterministic timeline for one UI motion transition.
Implementations§
Source§impl MotionTimeline
impl MotionTimeline
Sourcepub const fn new(spec: MotionSpec, started_at: Instant) -> Self
pub const fn new(spec: MotionSpec, started_at: Instant) -> Self
Creates a timeline that starts at the provided instant.
Sourcepub const fn spec(self) -> MotionSpec
pub const fn spec(self) -> MotionSpec
Returns the motion specification used by this timeline.
Sourcepub const fn started_at(self) -> Instant
pub const fn started_at(self) -> Instant
Returns the instant at which the timeline started.
Sourcepub const fn cancelled_at(self) -> Option<Instant>
pub const fn cancelled_at(self) -> Option<Instant>
Returns the instant at which the timeline was cancelled.
Sourcepub fn cancel_at(&mut self, cancelled_at: Instant)
pub fn cancel_at(&mut self, cancelled_at: Instant)
Marks the timeline as cancelled at the provided instant.
Sourcepub fn sample(self, now: Instant) -> MotionTimelineSample
pub fn sample(self, now: Instant) -> MotionTimelineSample
Samples the timeline at the provided instant.
Sourcepub fn sample_elapsed(
spec: MotionSpec,
elapsed: Duration,
) -> MotionTimelineSample
pub fn sample_elapsed( spec: MotionSpec, elapsed: Duration, ) -> MotionTimelineSample
Samples a motion spec using an explicit elapsed duration.
Trait Implementations§
Source§impl Clone for MotionTimeline
impl Clone for MotionTimeline
impl Copy for MotionTimeline
Source§impl Debug for MotionTimeline
impl Debug for MotionTimeline
impl Eq for MotionTimeline
Source§impl PartialEq for MotionTimeline
impl PartialEq for MotionTimeline
impl StructuralPartialEq for MotionTimeline
Auto Trait Implementations§
impl Freeze for MotionTimeline
impl RefUnwindSafe for MotionTimeline
impl Send for MotionTimeline
impl Sync for MotionTimeline
impl Unpin for MotionTimeline
impl UnsafeUnpin for MotionTimeline
impl UnwindSafe for MotionTimeline
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