[][src]Struct game_time::runner::FrameRunner

pub struct FrameRunner<C: FrameCount> { /* fields omitted */ }

A helper type for running frame simulations with a frame counter.

FrameRunner combines a GameClock and a FrameCount object, tracking each frame as well as a framerate. FrameRunner provides a tick method like GameClock, and updates both the GameClock and FrameCount objects contained.

Methods

impl<C> FrameRunner<C> where
    C: FrameCount
[src]

Construct a new FrameRunner from a GameClock and a FrameCount.

Get a reference to the contained GameClock.

Get a mutable reference to the contained GameClock.

Get a reference to the contained FrameCount.

Get a mutable reference to the contained FrameCount.

Mark the start of a new frame, updating time and frame rate statistics.

The GameTime for the new frame is returned, with the same properties as that returned from GameClock::tick.

Mark the start of a new frame with a specified wall time, updating time statistics.

This function is like tick but allows for the start time for the frame to be specified.

Perform one frame of the simulation using frame_fn.

The closure is passed the GameTime for the frame by calling tick and will call GameClock::sleep_remaining after the closure has ended.

Trait Implementations

impl<C: Debug + FrameCount> Debug for FrameRunner<C>
[src]

Auto Trait Implementations

impl<C> Send for FrameRunner<C> where
    C: Send

impl<C> Sync for FrameRunner<C> where
    C: Sync

Blanket Implementations

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

impl<T> From for T
[src]

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

impl<T, U> IntoDuration for T where
    U: FromDuration<T>, 
[src]