Trait PhysicsQuantity

Source
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§

Source

const INFINITY: Self

Source

const NEG_INFINITY: Self

Required Associated Types§

Required Methods§

Source

fn as_f64(&self) -> f64

Source

fn new(value: f64, unit: Self::Unit) -> Self

Source

fn to(&self, unit: Self::Unit) -> f64

Source

fn zero() -> Self

Source

fn get_tuple(&self) -> (f64, i32)

Source

fn abs(self) -> Self

Source

fn from_raw(value: f64) -> Self

Source

fn from_exponential(multiplier: f64, power: i32) -> Self

Source

fn min(self, other: Self) -> Self

Source

fn max(self, other: Self) -> Self

Source

fn get_power(&self) -> i32

Source

fn get_multiplier(&self) -> f64

Source

fn split_value(v: f64) -> (f64, i32)

Source

fn is_close(&self, other: &Self, tolerance: &Self) -> bool

Provided Methods§

Source

fn to_raw(&self) -> f64

👎Deprecated since 0.2.9: please use as_f64() instead
Source

fn get_value(&self) -> f64

👎Deprecated since 0.2.9: please use as_f64() instead

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.

Implementations on Foreign Types§

Source§

impl PhysicsQuantity for f64

Source§

const INFINITY: Self = +Inf_f64

Source§

const NEG_INFINITY: Self = -Inf_f64

Source§

type Unit = NoUnit

Source§

fn as_f64(&self) -> f64

Source§

fn new(value: f64, _unit: Self::Unit) -> Self

Source§

fn to(&self, _unit: Self::Unit) -> f64

Source§

fn zero() -> Self

Source§

fn get_tuple(&self) -> (f64, i32)

Source§

fn abs(self) -> Self

Source§

fn from_raw(value: f64) -> Self

Source§

fn from_exponential(multiplier: f64, power: i32) -> Self

Source§

fn min(self, other: Self) -> Self

Source§

fn max(self, other: Self) -> Self

Source§

fn get_power(&self) -> i32

Source§

fn get_multiplier(&self) -> f64

Source§

fn split_value(v: f64) -> (f64, i32)

Source§

fn is_close(&self, other: &Self, tolerance: &Self) -> bool

Implementors§

Source§

impl PhysicsQuantity for Acceleration

Source§

impl PhysicsQuantity for Angle

Source§

impl PhysicsQuantity for AngularAcceleration

Source§

impl PhysicsQuantity for AngularVelocity

Source§

impl PhysicsQuantity for Area

Source§

impl PhysicsQuantity for AreaOfMoment

Source§

impl PhysicsQuantity for Charge

Source§

impl PhysicsQuantity for Compliance

Source§

impl PhysicsQuantity for Density

Source§

impl PhysicsQuantity for Distance

Source§

impl PhysicsQuantity for Force

Source§

impl PhysicsQuantity for ForceArea

Source§

impl PhysicsQuantity for ForceDistance

Source§

impl PhysicsQuantity for ForcePerDistancePowerFour

Source§

impl PhysicsQuantity for ForcePerVolume

Source§

impl PhysicsQuantity for ForceVolume

Source§

impl PhysicsQuantity for InverseArea

Source§

impl PhysicsQuantity for InverseDistance

Source§

impl PhysicsQuantity for Mass

Source§

impl PhysicsQuantity for MassPerDistanceTimeSquare

Source§

impl PhysicsQuantity for MassPerTimeSquare

Source§

impl PhysicsQuantity for Stiffness

Source§

impl PhysicsQuantity for Strain

Source§

impl PhysicsQuantity for Stress

Source§

impl PhysicsQuantity for StressSquared

Source§

impl PhysicsQuantity for Time

Source§

impl PhysicsQuantity for Velocity

Source§

impl PhysicsQuantity for VelocitySquared

Source§

impl PhysicsQuantity for Voltage

Source§

impl PhysicsQuantity for Volume