pub struct Per<N: Unit, D: Unit>(/* private fields */);Expand description
Unit representing the division of two other units.
Per<N, D> corresponds to N / D and carries both the
dimensional information and the scaling ratio between the
constituent units. It is generic over any numerator and
denominator units, which allows implementing arithmetic
generically for all pairs without bespoke macros.
Trait Implementations§
Source§impl<N: PartialOrd + Unit, D: PartialOrd + Unit> PartialOrd for Per<N, D>
impl<N: PartialOrd + Unit, D: PartialOrd + Unit> PartialOrd for Per<N, D>
impl<N: Copy + Unit, D: Copy + Unit> Copy for Per<N, D>
impl<N: Unit, D: Unit> StructuralPartialEq for Per<N, D>
Auto Trait Implementations§
impl<N, D> Freeze for Per<N, D>
impl<N, D> RefUnwindSafe for Per<N, D>where
N: RefUnwindSafe,
D: RefUnwindSafe,
impl<N, D> Send for Per<N, D>
impl<N, D> Sync for Per<N, D>
impl<N, D> Unpin for Per<N, D>
impl<N, D> UnwindSafe for Per<N, D>where
N: UnwindSafe,
D: UnwindSafe,
Blanket Implementations§
Source§impl<T> AngularUnit for T
impl<T> AngularUnit for T
Source§const FULL_TURN: f64 = const FULL_TURN: f64 = Radians::new(TAU).to_const::<T>().value();
const FULL_TURN: f64 = const FULL_TURN: f64 = Radians::new(TAU).to_const::<T>().value();
One full revolution (360°) expressed in T unit.
Source§const HALF_TURN: f64 = const HALF_TURN: f64 = Radians::new(TAU).to_const::<T>().value() * 0.5;
const HALF_TURN: f64 = const HALF_TURN: f64 = Radians::new(TAU).to_const::<T>().value() * 0.5;
Half a revolution (180°) expressed in T unit.
Source§const QUARTED_TURN: f64 = const QUARTED_TURN: f64 = Radians::new(TAU).to_const::<T>().value() * 0.25;
const QUARTED_TURN: f64 = const QUARTED_TURN: f64 = Radians::new(TAU).to_const::<T>().value() * 0.25;
Quarter revolution (90°) expressed in T unit.
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more