Skip to main content

TweenTime

Trait TweenTime 

Source
pub trait TweenTime:
    Copy
    + PartialEq
    + PartialOrd
    + Debug
    + Add<Output = Self>
    + AddAssign
    + Rem<Output = Self>
    + Sub<Output = Self> {
    const ZERO: Self;

    // Required method
    fn to_f32(self) -> f32;
}
Expand description

A TweenTime is a representation of Time. The two most common will be f32/f64 for seconds and u32/u64/usize for frames.

If you want to implement your own time for duration, then you’ll need to implement this trait.

Required Associated Constants§

Source

const ZERO: Self

The ZERO value. This is 0 or 0.0.

Required Methods§

Source

fn to_f32(self) -> f32

Converts the given number to an f32.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl TweenTime for f32

Source§

const ZERO: Self = 0.0

Source§

fn to_f32(self) -> f32

Source§

impl TweenTime for f64

Source§

const ZERO: Self = 0.0

Source§

fn to_f32(self) -> f32

Source§

impl TweenTime for i8

Source§

const ZERO: Self = 0

Source§

fn to_f32(self) -> f32

Source§

impl TweenTime for i16

Source§

const ZERO: Self = 0

Source§

fn to_f32(self) -> f32

Source§

impl TweenTime for i32

Source§

const ZERO: Self = 0

Source§

fn to_f32(self) -> f32

Source§

impl TweenTime for i64

Source§

const ZERO: Self = 0

Source§

fn to_f32(self) -> f32

Source§

impl TweenTime for i128

Source§

const ZERO: Self = 0

Source§

fn to_f32(self) -> f32

Source§

impl TweenTime for isize

Source§

const ZERO: Self = 0

Source§

fn to_f32(self) -> f32

Source§

impl TweenTime for u8

Source§

const ZERO: Self = 0

Source§

fn to_f32(self) -> f32

Source§

impl TweenTime for u16

Source§

const ZERO: Self = 0

Source§

fn to_f32(self) -> f32

Source§

impl TweenTime for u32

Source§

const ZERO: Self = 0

Source§

fn to_f32(self) -> f32

Source§

impl TweenTime for u64

Source§

const ZERO: Self = 0

Source§

fn to_f32(self) -> f32

Source§

impl TweenTime for u128

Source§

const ZERO: Self = 0

Source§

fn to_f32(self) -> f32

Source§

impl TweenTime for usize

Source§

const ZERO: Self = 0

Source§

fn to_f32(self) -> f32

Implementors§