pub trait Quantity: Copy + Debug + Display + Sized + Borrow<f64> {
fn pack(_: f64) -> Self;
fn unpack(self) -> f64;
fn unwrap(self) -> f64;
fn into_option(self) -> Option<f64>;
}
Expand description
A quantity is a common super trait for types that represent units of measurement.
Required Methods
sourcefn unwrap(self) -> f64
fn unwrap(self) -> f64
Unwrap the value from the new type and check for validity, panic if contents are invalid.
sourcefn into_option(self) -> Option<f64>
fn into_option(self) -> Option<f64>
Convert into an option that is None
if the content is invalid.