[][src]Enum ftvf::Status

pub enum Status {
    Tick,
    Frame {
        phase: f32,
    },
    Idle,
    TimeWentBackwards,
    TicksLost(u64),
    Rollover,
}

Time handling information returned by a Metronome.

Variants

Tick

You should perform a logic tick.

Frame

You should render a frame.

Fields of Frame

phase: f32

Indicates where in time we are. In the range 0 (previous tick) to 1 (current tick), inclusive.

Idle

No Tick or Frame occurred this sample. You may want to call sleep_until_next_tick.

TimeWentBackwards

The NowSource reported a timestamp strictly earlier than a previous timestamp. This should never happen. A temporal anomaly is likely. This should be handled by showing some sort of warning, or ignored.

This may also occur when switching Modes on the same Metronome from TicksOnly to another mode, which usually would not happen.

TicksLost(u64)

Time is passing more quickly than we can process ticks; specifically, more than the Metronome's max_ticks_behind ticks worth of time has passed since the last time we finished a batch of ticks. This should be handled by showing some sort of warning, or ignored.

The value is the number of ticks' worth of time that were just lost.

Rollover

An obscenely huge amount of time has passed, and a rarely-used piece of logic within ftvf handled it correctly. You should ignore this unless you're testing ftvf.

In a typical application, the amount of time necessary to produce this variant is on the order of 18,000,000,000 years. Even in the most extreme case (2³²-1 ticks per second), over 136 years must pass for Rollover to occur. Unless your application is going to operate continuously for that kind of time frame, you will never encounter a Rollover; and even if it does, the fact that you did merely indicates that ftvf is handling the case correctly and nothing needs to be done on your end.

Trait Implementations

impl Clone for Status[src]

impl PartialEq<Status> for Status[src]

impl Copy for Status[src]

impl Debug for Status[src]

Auto Trait Implementations

impl Send for Status

impl Unpin for Status

impl Sync for Status

impl UnwindSafe for Status

impl RefUnwindSafe for Status

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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

impl<T> From<T> for 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.

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

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

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