pub trait PhysicsQuantity:
Copy
+ FromPrimitive
+ Zero
+ Add<Output = Self>
+ AddAssign
+ Div<f64, Output = Self>
+ DivAssign<f64>
+ Mul<f64, Output = Self>
+ MulAssign<f64>
+ Sub<Output = Self>
+ SubAssign
+ PartialOrd
+ Neg<Output = Self>
+ From<f64> {
type Unit: PhysicsUnit;
const INFINITY: Self;
const NEG_INFINITY: Self;
Show 16 methods
// Required methods
fn as_f64(&self) -> f64;
fn new(value: f64, unit: Self::Unit) -> Self;
fn to(&self, unit: Self::Unit) -> f64;
fn zero() -> Self;
fn get_tuple(&self) -> (f64, i32);
fn abs(self) -> Self;
fn from_raw(value: f64) -> Self;
fn from_exponential(multiplier: f64, power: i32) -> Self;
fn min(self, other: Self) -> Self;
fn max(self, other: Self) -> Self;
fn get_power(&self) -> i32;
fn get_multiplier(&self) -> f64;
fn split_value(v: f64) -> (f64, i32);
fn is_close(&self, other: &Self, tolerance: &Self) -> bool;
// Provided methods
fn to_raw(&self) -> f64 { ... }
fn get_value(&self) -> f64 { ... }
}Required Associated Constants§
const INFINITY: Self
const NEG_INFINITY: Self
Required Associated Types§
type Unit: PhysicsUnit
Required Methods§
fn as_f64(&self) -> f64
fn new(value: f64, unit: Self::Unit) -> Self
fn to(&self, unit: Self::Unit) -> f64
fn zero() -> Self
fn get_tuple(&self) -> (f64, i32)
fn abs(self) -> Self
fn from_raw(value: f64) -> Self
fn from_exponential(multiplier: f64, power: i32) -> Self
fn min(self, other: Self) -> Self
fn max(self, other: Self) -> Self
fn get_power(&self) -> i32
fn get_multiplier(&self) -> f64
fn split_value(v: f64) -> (f64, i32)
fn is_close(&self, other: &Self, tolerance: &Self) -> bool
Provided Methods§
fn to_raw(&self) -> f64
👎Deprecated since 0.2.9: please use
as_f64() insteadfn get_value(&self) -> f64
👎Deprecated since 0.2.9: please use
as_f64() insteadDyn 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.