#[non_exhaustive]pub enum Kind {
Plain,
AbsoluteTemperature,
TemperatureDifference,
}Expand description
The kind of a quantity on top of its dimension.
Two units with the same dimension but different kinds (for example degC and
delta_degC) are not interchangeable: a conversion between them is refused with
Error::KindMismatch. A temperature point (degC) converts to another point (K), and a
temperature difference (delta_degF) converts to another difference (delta_K). dimvexa
does not add or subtract quantities (ADR-014), so a kind has no arithmetic.
§Examples
use dimvexa_core::Kind;
assert_eq!(Kind::from_name("absolute_temperature"), Some(Kind::AbsoluteTemperature));
assert_eq!(Kind::TemperatureDifference.name(), "temperature_difference");Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Plain
An ordinary quantity without special rules.
AbsoluteTemperature
A point on a temperature scale (K, degC, degF, degR).
TemperatureDifference
An interval between two temperatures (delta_K, delta_degC, …).
Implementations§
Trait Implementations§
impl Copy for Kind
impl Eq for Kind
impl StructuralPartialEq for Kind
Auto Trait Implementations§
impl Forget for Kind
impl Freeze for Kind
impl RefUnwindSafe for Kind
impl Send for Kind
impl Sync for Kind
impl Unpin for Kind
impl UnsafeUnpin for Kind
impl UnwindSafe for Kind
Blanket Implementations§
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