Trait quantity::Unit [−][src]
pub trait Unit: Copy + PartialEq + Div<Output = Self> + Mul<Output = Self> + DivAssign + MulAssign + Display {
const DIMENSIONLESS: Self;
fn powi(&self, i: i32) -> Self;
fn sqrt(&self) -> Result<Self, QuantityError>;
fn cbrt(&self) -> Result<Self, QuantityError>;
fn root(&self, i: i32) -> Result<Self, QuantityError>;
fn is_dimensionless(&self) -> bool { ... }
}
Expand description
A generalized unit.
Associated Constants
const DIMENSIONLESS: Self
const DIMENSIONLESS: Self
The value of Self that corresponds to a dimensionless property.
Required methods
fn sqrt(&self) -> Result<Self, QuantityError>
fn sqrt(&self) -> Result<Self, QuantityError>
Try to calculate the square root of self.
fn cbrt(&self) -> Result<Self, QuantityError>
fn cbrt(&self) -> Result<Self, QuantityError>
Try to calculate the cubic root of self.
fn root(&self, i: i32) -> Result<Self, QuantityError>
fn root(&self, i: i32) -> Result<Self, QuantityError>
Try to calculate the integer root of self.
Provided methods
fn is_dimensionless(&self) -> bool
fn is_dimensionless(&self) -> bool
Returns true
if self
is dimensionless and false
otherwise.