#[non_exhaustive]pub enum Kind {
Plain,
AbsoluteTemperature,
TemperatureDifference,
GaugePressure,
NormalVolume,
StandardVolume,
}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
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, …).
GaugePressure
A pressure read relative to the (unspecified) ambient pressure: psig, barg, Pag
(ADR-013). It converts only to another gauge unit.
NormalVolume
A gas volume at the normal state of DIN 1343 (273.15 K, 101 325 Pa): Nm3 (ADR-013).
StandardVolume
A gas volume at 60 degF and 14.696 psia: scf (ADR-013).
Implementations§
Source§impl Kind
impl Kind
Sourcepub const fn is_reference(self) -> bool
pub const fn is_reference(self) -> bool
True for a kind that is tied to a stated reference state (ADR-013). Such a unit
converts only to a unit of the same kind, and the kind survives in compound units
(Nm3/h keeps the reference of Nm3).
Sourcepub const fn name(self) -> &'static str
pub const fn name(self) -> &'static str
The stable lower-case name used in data files and JSON output.
Sourcepub fn from_name(name: &str) -> Option<Self>
pub fn from_name(name: &str) -> Option<Self>
Reads a name produced by Kind::name.