pub struct Timeline<T> { /* private fields */ }
Expand description
control your animation
Implementations§
Source§impl<T> Timeline<T>
impl<T> Timeline<T>
Sourcepub fn new<F>(animation: F) -> Selfwhere
F: Animation<Item = T> + 'static,
pub fn new<F>(animation: F) -> Selfwhere
F: Animation<Item = T> + 'static,
construct your animation
Sourcepub fn id(&self) -> TimelineId
pub fn id(&self) -> TimelineId
the unique id of your animation
Sourcepub fn resume(&mut self)
pub fn resume(&mut self)
continue your animation if it was paused, otherwise start new animation
Sourcepub fn reset(&mut self)
pub fn reset(&mut self)
if animation was stopped, it might keep its progress, you can clear it by this method
Sourcepub fn update_with_time(&mut self, now: Instant) -> Status
pub fn update_with_time(&mut self, now: Instant) -> Status
update the timeline
Trait Implementations§
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> 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