pub enum Unit {
Show 30 variants
Unknown,
AbsorbanceUnit,
Celsius,
CountsPerSecond,
DetectorCounts,
Dimensionless,
Electronvolt,
Kelvin,
Mass,
MicrolitersPerMinute,
Millisecond,
Minute,
MZ,
Nanometer,
Micrometer,
Millimeter,
Centimeter,
PartsPerMillion,
Pascal,
Percent,
PercentBasePeak,
PercentBasePeakTimes100,
Psi,
Second,
Volt,
VoltSecondPerSquareCentimeter,
Hertz,
Liter,
Milliliter,
Microliter,
}Expand description
Units that a term’s value might have
Variants§
Unknown
AbsorbanceUnit
Celsius
CountsPerSecond
DetectorCounts
Dimensionless
Electronvolt
Kelvin
Mass
MicrolitersPerMinute
Millisecond
Minute
MZ
Nanometer
Micrometer
Millimeter
Centimeter
PartsPerMillion
Pascal
Percent
PercentBasePeak
PercentBasePeakTimes100
Psi
Second
Volt
VoltSecondPerSquareCentimeter
Hertz
Liter
Milliliter
Microliter
Implementations§
Source§impl Unit
impl Unit
Sourcepub const fn for_param(&self) -> (&'static str, &'static str)
pub const fn for_param(&self) -> (&'static str, &'static str)
The (accession, name) pair for this unit’s CV term, or ("", "") for
Unit::Unknown.
Sourcepub const fn from_name(name: &str) -> Unit
pub const fn from_name(name: &str) -> Unit
Look up a Unit by its CV term name (e.g. "minute"). Returns
Unit::Unknown if unrecognized.
Sourcepub const fn from_accession(acc: &str) -> Unit
pub const fn from_accession(acc: &str) -> Unit
Look up a Unit by its CV accession string (e.g. "UO:0000031").
Returns Unit::Unknown if unrecognized.
Sourcepub const fn from_curie(acc: &CURIE) -> Unit
pub const fn from_curie(acc: &CURIE) -> Unit
Look up a Unit by its CURIE. Returns Unit::Unknown if
unrecognized.
Sourcepub const fn to_curie(&self) -> Option<CURIE>
pub const fn to_curie(&self) -> Option<CURIE>
The CURIE for this unit’s CV term, or None for Unit::Unknown.
Sourcepub const fn from_param(param: &Param) -> Unit
pub const fn from_param(param: &Param) -> Unit
Read the Param::unit of a Param directly.
Sourcepub const fn is_unknown(&self) -> bool
pub const fn is_unknown(&self) -> bool
Check whether this is the Unit::Unknown sentinel.
Trait Implementations§
impl Copy for Unit
impl Eq for Unit
Source§impl Ord for Unit
impl Ord for Unit
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for Unit
impl PartialOrd 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§
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