Trait Angle

Source
pub trait Angle<S: Real>:
    Clone
    + Copy
    + PartialEq
    + PartialOrd
    + Sized
    + AdditiveGroup
    + Div<Self, Output = S>
    + Mul<S, Output = Self>
    + Div<S, Output = Self>
    + Rem<Self, Output = Self> {
    // Required method
    fn full_turn() -> Self;

    // Provided methods
    fn half_turn() -> Self { ... }
    fn wrap_signed(self) -> Self { ... }
    fn wrap_unsigned(self) -> Self { ... }
}
Expand description

Interface for angle units

Required Methods§

Source

fn full_turn() -> Self

Full rotation

Provided Methods§

Source

fn half_turn() -> Self

Half rotation

Source

fn wrap_signed(self) -> Self

Restrict to (-half_turn, half_turn]

Source

fn wrap_unsigned(self) -> Self

Restrict to [0, full_turn)

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<S: Real> Angle<S> for Deg<S>

Source§

impl<S: Real> Angle<S> for Rad<S>

Source§

impl<S: Real> Angle<S> for Turn<S>