Unit

Trait Unit 

Source
pub trait Unit<F: Float>: Sized {
    const DBG_NAME: &'static str;
    const QUARTER_TURN: F;
    const HALF_TURN: F;
    const FULL_TURN: F;

    // Required method
    fn display(val: F, f: &mut Formatter<'_>) -> Result
       where F: Display;
}
Expand description

A unit of measurement for an Angle.

Required Associated Constants§

Source

const DBG_NAME: &'static str

Source

const QUARTER_TURN: F

Number for a quarter turn around a circle in this unit space.

Source

const HALF_TURN: F

Number for a half turn around a circle in this unit space.

Source

const FULL_TURN: F

Number for a full turn around a circle in this unit space.

Required Methods§

Source

fn display(val: F, f: &mut Formatter<'_>) -> Result
where F: Display,

How to format Angles of this type.

§Errors

If formatting fails.

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.

Implementors§

Source§

impl<F: Float> Unit<F> for Degrees

Source§

const DBG_NAME: &'static str = "Deg"

Source§

const QUARTER_TURN: F = F::NINETY

Source§

const HALF_TURN: F = F::ONE_EIGHTY

Source§

const FULL_TURN: F = F::THREE_SIXTY

Source§

impl<F: Float> Unit<F> for Radians

Source§

const DBG_NAME: &'static str = "Rad"

Source§

const QUARTER_TURN: F = F::PI_OVER_TWO

Source§

const HALF_TURN: F = F::PI

Source§

const FULL_TURN: F = F::TAU