[][src]Struct silver_animation::AnimationTimer

pub struct AnimationTimer<T, MaxFrames: Fn(&T) -> usize> { /* fields omitted */ }

This struct decides what frame count the animation is currently at, it automatically resets to 0.

Implementations

impl<T, MaxFrames> AnimationTimer<T, MaxFrames> where
    MaxFrames: Fn(&T) -> usize
[src]

pub fn new(max_frames: MaxFrames, timer: Timer) -> AnimationTimer<T, MaxFrames>[src]

pub fn get_current_frame(&mut self, state: &T) -> usize[src]

pub fn reset(&mut self)[src]

Auto Trait Implementations

impl<T, MaxFrames> RefUnwindSafe for AnimationTimer<T, MaxFrames> where
    MaxFrames: RefUnwindSafe,
    T: RefUnwindSafe

impl<T, MaxFrames> Send for AnimationTimer<T, MaxFrames> where
    MaxFrames: Send,
    T: Send

impl<T, MaxFrames> Sync for AnimationTimer<T, MaxFrames> where
    MaxFrames: Sync,
    T: Sync

impl<T, MaxFrames> Unpin for AnimationTimer<T, MaxFrames> where
    MaxFrames: Unpin,
    T: Unpin

impl<T, MaxFrames> UnwindSafe for AnimationTimer<T, MaxFrames> where
    MaxFrames: UnwindSafe,
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.