Struct Timeline

Source
pub struct Timeline<T> { /* private fields */ }
Expand description

control your animation

Implementations§

Source§

impl<T> Timeline<T>

Source

pub fn new<F>(animation: F) -> Self
where F: Animation<Item = T> + 'static,

construct your animation

Source

pub fn id(&self) -> TimelineId

the unique id of your animation

Source

pub fn begin(&mut self)

start your animation; if it’s not completed yet, restart it

Source

pub fn stop(&mut self)

stop your animation

Source

pub fn pause(&mut self)

pause your animation only if it’s animating

Source

pub fn resume(&mut self)

continue your animation if it was paused, otherwise start new animation

Source

pub fn reset(&mut self)

if animation was stopped, it might keep its progress, you can clear it by this method

Source

pub fn status(&self) -> Status

the status of your animation

Source

pub fn value(&self) -> T

the current value of your animation

Source

pub fn update(&mut self) -> Status

update the timeline

Source

pub fn update_with_time(&mut self, now: Instant) -> Status

update the timeline

Trait Implementations§

Source§

impl<T: Debug> Debug for Timeline<T>

Source§

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

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

impl<T: Animatable + 'static> From<Options<T>> for Timeline<T>

Source§

fn from(opt: Options<T>) -> Self

Converts to this type from the input type.
Source§

impl<T: Animation + 'static> From<T> for Timeline<T::Item>

Source§

fn from(src: T) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<T> Freeze for Timeline<T>

§

impl<T> !RefUnwindSafe for Timeline<T>

§

impl<T> !Send for Timeline<T>

§

impl<T> !Sync for Timeline<T>

§

impl<T> Unpin for Timeline<T>

§

impl<T> !UnwindSafe for Timeline<T>

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> 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, 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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V