Skip to main content

AnimationTrack

Struct AnimationTrack 

Source
pub struct AnimationTrack<T: Animatable> { /* private fields */ }
Expand description

Shared animation timeline state for values implementing Animatable.

Implementations§

Source§

impl<T: Animatable> AnimationTrack<T>

Source

pub const fn new(initial: T) -> Self

Create a track seeded with an initial value.

Source

pub fn value(&self) -> T

Current sampled value.

Source

pub fn set_target(&mut self, target: T, animation: Option<Animation>)

Replace the target value.

If animation metadata is absent, the value is applied immediately.

Source

pub fn advance(&mut self, delta: Duration) -> bool

Advance by a frame delta.

Returns true while an animation remains active after advancement.

Source

pub const fn is_active(&self) -> bool

Whether this track has an active animation.

Trait Implementations§

Source§

impl<T: Clone + Animatable> Clone for AnimationTrack<T>

Source§

fn clone(&self) -> AnimationTrack<T>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T: Debug + Animatable> Debug for AnimationTrack<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<T> Freeze for AnimationTrack<T>
where T: Freeze, Option<ActiveTrack<T>>: Freeze,

§

impl<T> RefUnwindSafe for AnimationTrack<T>
where T: RefUnwindSafe, Option<ActiveTrack<T>>: RefUnwindSafe,

§

impl<T> Send for AnimationTrack<T>
where T: Send, Option<ActiveTrack<T>>: Send,

§

impl<T> Sync for AnimationTrack<T>
where T: Sync, Option<ActiveTrack<T>>: Sync,

§

impl<T> Unpin for AnimationTrack<T>
where T: Unpin, Option<ActiveTrack<T>>: Unpin,

§

impl<T> UnsafeUnpin for AnimationTrack<T>
where T: UnsafeUnpin, Option<ActiveTrack<T>>: UnsafeUnpin,

§

impl<T> UnwindSafe for AnimationTrack<T>
where T: UnwindSafe, Option<ActiveTrack<T>>: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> IdentifiableExt for T

Source§

fn use_id<F, Id>(self, f: F) -> UseId<Self, F>
where F: Fn(&Self) -> Id, Id: Ord + Hash,

Wraps the value in a UseId with the provided identification function.
Source§

fn self_id(self) -> SelfId<Self>

Wraps the value in a SelfId, making the value serve as its own identifier.
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.