pub trait Quantity:
Add<Output = Self>
+ Sub<Output = Self>
+ Mul<Percentage, Output = Self>
+ Mul<f32, Output = Self>
+ Div<f32, Output = Self>
+ Div<Self, Output = f32>
+ PartialOrd
+ Display
+ Copy
+ Clone
+ Debug
+ Default
+ Sized
+ Send
+ Sync {
const MIN: Self;
const MAX: Self;
// Required methods
fn abs(self) -> Self;
fn floor(self) -> Self;
fn ceil(self) -> Self;
fn round(self) -> Self;
fn trunc(self) -> Self;
fn fract(self) -> Self;
fn is_nan(self) -> bool;
fn is_infinite(self) -> bool;
fn min(self, other: Self) -> Self;
fn max(self, other: Self) -> Self;
// Provided method
fn zero() -> Self { ... }
}Expand description
A trait for physical quantities that supports basic arithmetic operations.
Required Associated Constants§
Required Methods§
fn abs(self) -> Self
fn floor(self) -> Self
fn ceil(self) -> Self
fn round(self) -> Self
fn trunc(self) -> Self
fn fract(self) -> Self
fn is_nan(self) -> bool
fn is_infinite(self) -> bool
fn min(self, other: Self) -> Self
fn max(self, other: Self) -> Self
Provided Methods§
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.