#[non_exhaustive]pub enum Quantity {
Simple {
id: EntityId,
name: Option<Arc<str>>,
description: Option<Arc<str>>,
kind: QuantityKind,
value: f64,
unit: Option<EntityId>,
formula: Option<Arc<str>>,
},
Unresolved {
id: EntityId,
name: Option<Arc<str>>,
description: Option<Arc<str>>,
kind: QuantityKind,
unit: Option<EntityId>,
formula: Option<Arc<str>>,
reason: UnresolvedValue,
},
Complex {
id: EntityId,
name: Option<Arc<str>>,
discrimination: Option<Arc<str>>,
quantities: Vec<Quantity>,
},
Unsupported {
id: EntityId,
type_name: Arc<str>,
},
}Expand description
One physical quantity.
Non-exhaustive: a match needs a wildcard arm, and code that sums or
compares values should match Quantity::Simple and decide explicitly
what an Quantity::Unresolved quantity means for it.
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.
Simple
A simple measured value.
Fields
§
kind: QuantityKindWhat it measures.
Unresolved
A simple quantity whose value attribute holds no number: $, missing
from a truncated record, or not numeric.
Kept in its place so the set still lists it; there is deliberately
no value to read as 0. The same fault is reported as
PropertyAnomaly::QuantityValueMissing or
PropertyAnomaly::QuantityValueNotNumeric.
Complex
A nested group of quantities.
Fields
Unsupported
A concrete quantity type this crate does not model.
Implementations§
Trait Implementations§
impl StructuralPartialEq for Quantity
Auto Trait Implementations§
impl Freeze for Quantity
impl RefUnwindSafe for Quantity
impl Send for Quantity
impl Sync for Quantity
impl Unpin for Quantity
impl UnsafeUnpin for Quantity
impl UnwindSafe for Quantity
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