zng_layout::unit

Trait AngleUnits

source
pub trait AngleUnits {
    // Required methods
    fn rad(self) -> AngleRadian;
    fn grad(self) -> AngleGradian;
    fn deg(self) -> AngleDegree;
    fn turn(self) -> AngleTurn;
}
Expand description

Extension methods for initializing angle units.

This trait is implemented for f32 and u32 allowing initialization of angle unit types using the <number>.<unit>() syntax.

§Examples

let radians = 6.28318.rad();
let gradians = 400.grad();
let degrees = 360.deg();
let turns = 1.turn();

Required Methods§

source

fn rad(self) -> AngleRadian

Radians

source

fn grad(self) -> AngleGradian

Gradians

source

fn deg(self) -> AngleDegree

Degrees

source

fn turn(self) -> AngleTurn

Turns

Implementations on Foreign Types§

source§

impl AngleUnits for f32

source§

impl AngleUnits for i32

Implementors§