UnitNumber

Struct UnitNumber 

Source
pub struct UnitNumber<U> { /* private fields */ }

Implementations§

Source§

impl UnitNumber<FrequencyUnit>

Source

pub fn to_period(&self) -> Time

Source§

impl UnitNumber<TimeUnit>

Source

pub fn to_frquency(&self) -> Frequency

Source§

impl<U: Unit> UnitNumber<U>

Source

pub fn new<N: Into<Number>>(number: N) -> Self

Source

pub fn to_f64(&self) -> f64

Source

pub fn value(&self) -> Number

Source

pub fn is_nan(self) -> bool

Source

pub fn is_finite(self) -> bool

Source

pub fn powf(self, exp: f64) -> Self

Source

pub fn atan2(self, other: Self) -> Number

Source§

impl<U: Unit> UnitNumber<U>

Source

pub fn abs(&self) -> Self

Source

pub fn ceil(&self) -> Self

Source

pub fn floor(&self) -> Self

Source

pub fn round(&self) -> Self

Source

pub fn trunc(&self) -> Self

Source

pub fn fract(&self) -> Self

Source

pub fn sqrt(&self) -> Self

Source

pub fn exp(&self) -> Self

Source

pub fn ln(&self) -> Self

Source

pub fn log10(&self) -> Self

Source

pub fn log2(&self) -> Self

Source

pub fn recip(&self) -> Self

Source

pub fn sin(&self) -> Self

Source

pub fn cos(&self) -> Self

Source

pub fn tan(&self) -> Self

Source

pub fn asin(&self) -> Self

Source

pub fn acos(&self) -> Self

Source

pub fn atan(&self) -> Self

Source

pub fn sinh(&self) -> Self

Source

pub fn cosh(&self) -> Self

Source

pub fn tanh(&self) -> Self

Source

pub fn to_degrees(&self) -> Self

Source

pub fn to_radians(&self) -> Self

Trait Implementations§

Source§

impl<U: Unit> Add for UnitNumber<U>

Source§

type Output = UnitNumber<U>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: UnitNumber<U>) -> Self::Output

Performs the + operation. Read more
Source§

impl<U: Clone> Clone for UnitNumber<U>

Source§

fn clone(&self) -> UnitNumber<U>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<U: Debug> Debug for UnitNumber<U>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de, U: Unit> Deserialize<'de> for UnitNumber<U>

Source§

fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<U: Unit> Display for UnitNumber<U>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<U: Unit> Div<Number> for UnitNumber<U>

Source§

type Output = UnitNumber<U>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Number) -> Self

Performs the / operation. Read more
Source§

impl Div<UnitNumber<AreaUnit>> for UnitNumber<ForceUnit>

Source§

type Output = UnitNumber<PressureUnit>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: UnitNumber<AreaUnit>) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<UnitNumber<AreaUnit>> for UnitNumber<MagneticFluxUnit>

Source§

type Output = UnitNumber<FluxDensityUnit>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: UnitNumber<AreaUnit>) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<UnitNumber<CapacitanceUnit>> for UnitNumber<ChargeUnit>

Source§

type Output = UnitNumber<VoltageUnit>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: UnitNumber<CapacitanceUnit>) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<UnitNumber<ChargeUnit>> for UnitNumber<CurrentUnit>

Source§

type Output = UnitNumber<TimeUnit>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: UnitNumber<ChargeUnit>) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<UnitNumber<CurrentUnit>> for UnitNumber<ChargeUnit>

Source§

type Output = UnitNumber<TimeUnit>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: UnitNumber<CurrentUnit>) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<UnitNumber<CurrentUnit>> for UnitNumber<PowerUnit>

Source§

type Output = UnitNumber<VoltageUnit>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: UnitNumber<CurrentUnit>) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<UnitNumber<CurrentUnit>> for UnitNumber<VoltageUnit>

Source§

type Output = UnitNumber<ResistanceUnit>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: UnitNumber<CurrentUnit>) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<UnitNumber<FluxDensityUnit>> for UnitNumber<MagneticFluxUnit>

Source§

type Output = UnitNumber<AreaUnit>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: UnitNumber<FluxDensityUnit>) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<UnitNumber<ForceUnit>> for UnitNumber<EnergyUnit>

Source§

type Output = UnitNumber<LengthUnit>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: UnitNumber<ForceUnit>) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<UnitNumber<ForceUnit>> for UnitNumber<PowerUnit>

Source§

type Output = UnitNumber<VelocityUnit>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: UnitNumber<ForceUnit>) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<UnitNumber<LengthUnit>> for UnitNumber<AreaUnit>

Source§

type Output = UnitNumber<LengthUnit>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: UnitNumber<LengthUnit>) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<UnitNumber<LengthUnit>> for UnitNumber<EnergyUnit>

Source§

type Output = UnitNumber<ForceUnit>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: UnitNumber<LengthUnit>) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<UnitNumber<PowerUnit>> for UnitNumber<EnergyUnit>

Source§

type Output = UnitNumber<TimeUnit>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: UnitNumber<PowerUnit>) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<UnitNumber<PressureUnit>> for UnitNumber<ForceUnit>

Source§

type Output = UnitNumber<AreaUnit>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: UnitNumber<PressureUnit>) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<UnitNumber<ResistanceUnit>> for UnitNumber<VoltageUnit>

Source§

type Output = UnitNumber<CurrentUnit>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: UnitNumber<ResistanceUnit>) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<UnitNumber<TimeUnit>> for UnitNumber<ChargeUnit>

Source§

type Output = UnitNumber<CurrentUnit>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: UnitNumber<TimeUnit>) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<UnitNumber<TimeUnit>> for UnitNumber<CurrentUnit>

Source§

type Output = UnitNumber<ChargeUnit>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: UnitNumber<TimeUnit>) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<UnitNumber<TimeUnit>> for UnitNumber<EnergyUnit>

Source§

type Output = UnitNumber<PowerUnit>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: UnitNumber<TimeUnit>) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<UnitNumber<TimeUnit>> for UnitNumber<LengthUnit>

Source§

type Output = UnitNumber<VelocityUnit>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: UnitNumber<TimeUnit>) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<UnitNumber<TimeUnit>> for UnitNumber<MagneticFluxUnit>

Source§

type Output = UnitNumber<VoltageUnit>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: UnitNumber<TimeUnit>) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<UnitNumber<VelocityUnit>> for UnitNumber<LengthUnit>

Source§

type Output = UnitNumber<TimeUnit>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: UnitNumber<VelocityUnit>) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<UnitNumber<VelocityUnit>> for UnitNumber<PowerUnit>

Source§

type Output = UnitNumber<ForceUnit>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: UnitNumber<VelocityUnit>) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<UnitNumber<VoltageUnit>> for UnitNumber<ChargeUnit>

Source§

type Output = UnitNumber<CapacitanceUnit>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: UnitNumber<VoltageUnit>) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<UnitNumber<VoltageUnit>> for UnitNumber<MagneticFluxUnit>

Source§

type Output = UnitNumber<TimeUnit>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: UnitNumber<VoltageUnit>) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<UnitNumber<VoltageUnit>> for UnitNumber<PowerUnit>

Source§

type Output = UnitNumber<CurrentUnit>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: UnitNumber<VoltageUnit>) -> Self::Output

Performs the / operation. Read more
Source§

impl<U: Unit> Div<f64> for UnitNumber<U>

Source§

type Output = UnitNumber<U>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: f64) -> Self

Performs the / operation. Read more
Source§

impl<U: Unit> Div for UnitNumber<U>

Source§

type Output = Number

The resulting type after applying the / operator.
Source§

fn div(self, rhs: UnitNumber<U>) -> Self::Output

Performs the / operation. Read more
Source§

impl<U: Unit> From<Number> for UnitNumber<U>

Source§

fn from(value: Number) -> Self

Converts to this type from the input type.
Source§

impl<U: Unit> From<f32> for UnitNumber<U>

Source§

fn from(value: f32) -> Self

Converts to this type from the input type.
Source§

impl<U: Unit> From<f64> for UnitNumber<U>

Source§

fn from(value: f64) -> Self

Converts to this type from the input type.
Source§

impl<U: Unit> From<i32> for UnitNumber<U>

Source§

fn from(value: i32) -> Self

Converts to this type from the input type.
Source§

impl<U: Unit> From<u32> for UnitNumber<U>

Source§

fn from(value: u32) -> Self

Converts to this type from the input type.
Source§

impl<U: Unit> FromStr for UnitNumber<U>

Source§

type Err = String

The associated error which can be returned from parsing.
Source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
Source§

impl<U: Unit> Mul<Number> for UnitNumber<U>

Source§

type Output = UnitNumber<U>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Number) -> Self

Performs the * operation. Read more
Source§

impl Mul<UnitNumber<AreaUnit>> for UnitNumber<FluxDensityUnit>

Source§

type Output = UnitNumber<MagneticFluxUnit>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: UnitNumber<AreaUnit>) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<UnitNumber<AreaUnit>> for UnitNumber<PressureUnit>

Source§

type Output = UnitNumber<ForceUnit>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: UnitNumber<AreaUnit>) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<UnitNumber<CurrentUnit>> for UnitNumber<ResistanceUnit>

Source§

type Output = UnitNumber<VoltageUnit>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: UnitNumber<CurrentUnit>) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<UnitNumber<CurrentUnit>> for UnitNumber<VoltageUnit>

Source§

type Output = UnitNumber<PowerUnit>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: UnitNumber<CurrentUnit>) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<UnitNumber<FrequencyUnit>> for Time

Source§

type Output = Number

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Frequency) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<UnitNumber<LengthUnit>> for UnitNumber<ForceUnit>

Source§

type Output = UnitNumber<EnergyUnit>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: UnitNumber<LengthUnit>) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<UnitNumber<TimeUnit>> for UnitNumber<ChargeUnit>

Source§

type Output = UnitNumber<CurrentUnit>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: UnitNumber<TimeUnit>) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<UnitNumber<TimeUnit>> for UnitNumber<CurrentUnit>

Source§

type Output = UnitNumber<ChargeUnit>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: UnitNumber<TimeUnit>) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<UnitNumber<TimeUnit>> for Frequency

Source§

type Output = Number

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Time) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<UnitNumber<TimeUnit>> for UnitNumber<PowerUnit>

Source§

type Output = UnitNumber<EnergyUnit>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: UnitNumber<TimeUnit>) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<UnitNumber<TimeUnit>> for UnitNumber<VelocityUnit>

Source§

type Output = UnitNumber<LengthUnit>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: UnitNumber<TimeUnit>) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<UnitNumber<TimeUnit>> for UnitNumber<VoltageUnit>

Source§

type Output = UnitNumber<MagneticFluxUnit>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: UnitNumber<TimeUnit>) -> Self::Output

Performs the * operation. Read more
Source§

impl<U: Unit> Mul<UnitNumber<U>> for Number

Source§

type Output = UnitNumber<U>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: UnitNumber<U>) -> UnitNumber<U>

Performs the * operation. Read more
Source§

impl<U: Unit> Mul<UnitNumber<U>> for f64

Source§

type Output = UnitNumber<U>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: UnitNumber<U>) -> UnitNumber<U>

Performs the * operation. Read more
Source§

impl Mul<UnitNumber<VelocityUnit>> for UnitNumber<ForceUnit>

Source§

type Output = UnitNumber<PowerUnit>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: UnitNumber<VelocityUnit>) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<UnitNumber<VoltageUnit>> for UnitNumber<CapacitanceUnit>

Source§

type Output = UnitNumber<ChargeUnit>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: UnitNumber<VoltageUnit>) -> Self::Output

Performs the * operation. Read more
Source§

impl<U: Unit> Mul<f64> for UnitNumber<U>

Source§

type Output = UnitNumber<U>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: f64) -> Self

Performs the * operation. Read more
Source§

impl Mul for UnitNumber<LengthUnit>

Source§

type Output = UnitNumber<AreaUnit>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: UnitNumber<LengthUnit>) -> Self::Output

Performs the * operation. Read more
Source§

impl<U: Unit> Neg for UnitNumber<U>

Source§

type Output = UnitNumber<U>

The resulting type after applying the - operator.
Source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
Source§

impl<U: Unit> Ord for UnitNumber<U>

Source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

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

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

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

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl<U: PartialEq> PartialEq for UnitNumber<U>

Source§

fn eq(&self, other: &UnitNumber<U>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<U: Unit> PartialOrd for UnitNumber<U>

Source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<U: Unit> Rem for UnitNumber<U>

Source§

type Output = UnitNumber<U>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: UnitNumber<U>) -> Self::Output

Performs the % operation. Read more
Source§

impl<U: Unit> Serialize for UnitNumber<U>

Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<U: Unit> Sub for UnitNumber<U>

Source§

type Output = UnitNumber<U>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Self) -> Self::Output

Performs the - operation. Read more
Source§

impl<U: Copy> Copy for UnitNumber<U>

Source§

impl<U: Eq> Eq for UnitNumber<U>

Source§

impl<U> StructuralPartialEq for UnitNumber<U>

Auto Trait Implementations§

§

impl<U> Freeze for UnitNumber<U>

§

impl<U> RefUnwindSafe for UnitNumber<U>
where U: RefUnwindSafe,

§

impl<U> Send for UnitNumber<U>
where U: Send,

§

impl<U> Sync for UnitNumber<U>
where U: Sync,

§

impl<U> Unpin for UnitNumber<U>
where U: Unpin,

§

impl<U> UnwindSafe for UnitNumber<U>
where U: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,