Skip to main content

AnimationState

Struct AnimationState 

Source
pub struct AnimationState<Prop>
where Prop: Interpolator,
{
Show 13 fields pub indices: Vec<usize>, pub start_time: Instant, pub duration: Duration, pub delay: f32, pub keyframes: Vec<(f32, Prop)>, pub output: Option<Prop>, pub persistent: bool, pub t0: f32, pub t: f32, pub active: bool, pub from_rule: usize, pub to_rule: usize, pub entities: Vec<Entity>,
}

Fields§

§indices: Vec<usize>§start_time: Instant§duration: Duration§delay: f32§keyframes: Vec<(f32, Prop)>§output: Option<Prop>§persistent: bool§t0: f32§t: f32§active: bool§from_rule: usize§to_rule: usize§entities: Vec<Entity>

Implementations§

Source§

impl<Prop> AnimationState<Prop>
where Prop: Interpolator,

Source

pub fn new() -> AnimationState<Prop>

Source

pub fn with_duration(self, duration: Duration) -> AnimationState<Prop>

Source

pub fn with_delay(self, delay: Duration) -> AnimationState<Prop>

Source

pub fn set_delay(&mut self, delay: Duration) -> &mut AnimationState<Prop>

Source

pub fn with_keyframe(self, key: (f32, Prop)) -> AnimationState<Prop>

Source

pub fn interpolate(&mut self, current_time: Instant) -> bool

Source

pub fn set_persistent(self, flag: bool) -> AnimationState<Prop>

Source

pub fn get_output(&self) -> Option<&Prop>

Trait Implementations§

Source§

impl<Prop> Clone for AnimationState<Prop>
where Prop: Clone + Interpolator,

Source§

fn clone(&self) -> AnimationState<Prop>

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<Prop> Debug for AnimationState<Prop>
where Prop: Debug + Interpolator,

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<Prop> Default for AnimationState<Prop>
where Prop: Interpolator,

Source§

fn default() -> AnimationState<Prop>

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<Prop> Freeze for AnimationState<Prop>
where Prop: Freeze,

§

impl<Prop> RefUnwindSafe for AnimationState<Prop>
where Prop: RefUnwindSafe,

§

impl<Prop> Send for AnimationState<Prop>
where Prop: Send,

§

impl<Prop> Sync for AnimationState<Prop>
where Prop: Sync,

§

impl<Prop> Unpin for AnimationState<Prop>
where Prop: Unpin,

§

impl<Prop> UnsafeUnpin for AnimationState<Prop>
where Prop: UnsafeUnpin,

§

impl<Prop> UnwindSafe for AnimationState<Prop>
where Prop: 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, 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 = Infallible

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.
Source§

impl<T> Node for T
where T: 'static,