pub struct Unit {
pub name: &'static str,
pub dimension: Dimension,
pub to_si_factor: f64,
pub to_si_offset: f64,
}Expand description
A named unit of a given dimension, defined by its affine map to coherent SI base
units: si_value = value * to_si_factor + to_si_offset.
Fields§
§name: &'static str§dimension: Dimension§to_si_factor: f64§to_si_offset: f64Implementations§
Source§impl Unit
impl Unit
pub const METRE: Unit
pub const KILOMETRE: Unit
pub const CENTIMETRE: Unit
pub const MILLIMETRE: Unit
pub const INCH: Unit
pub const FOOT: Unit
pub const MILE: Unit
pub const KILOGRAM: Unit
pub const GRAM: Unit
pub const POUND: Unit
pub const SECOND: Unit
pub const MINUTE: Unit
pub const HOUR: Unit
pub const NEWTON: Unit
pub const JOULE: Unit
pub const KILOWATT_HOUR: Unit
pub const PASCAL: Unit
pub const BAR: Unit
pub const KELVIN: Unit
pub const CELSIUS: Unit
pub const FAHRENHEIT: Unit
pub const fn linear( name: &'static str, dimension: Dimension, factor: f64, ) -> Self
pub const fn affine( name: &'static str, dimension: Dimension, factor: f64, offset: f64, ) -> Self
Trait Implementations§
impl Copy for Unit
impl StructuralPartialEq for Unit
Auto Trait Implementations§
impl Freeze for Unit
impl RefUnwindSafe for Unit
impl Send for Unit
impl Sync for Unit
impl Unpin for Unit
impl UnsafeUnpin for Unit
impl UnwindSafe for Unit
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
Aggregate shares in an MPC protocol.
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more