pub struct Quantity {
pub meta: Bo4eMeta,
pub value: Option<f64>,
pub unit: Option<Unit>,
}Expand description
A quantity with value and unit.
German: Menge
§Example
use bo4e_core::com::Quantity;
use bo4e_core::enums::Unit;
let qty = Quantity {
value: Some(3500.0),
unit: Some(Unit::KilowattHour),
..Default::default()
};Fields§
§meta: Bo4eMetaBO4E metadata
value: Option<f64>Numeric value (Wert)
unit: Option<Unit>Unit of measurement (Einheit)
Implementations§
Trait Implementations§
Source§impl Bo4eObject for Quantity
impl Bo4eObject for Quantity
Source§fn type_name_german() -> &'static str
fn type_name_german() -> &'static str
Returns the German type name as used in the
_typ field. Read moreSource§fn type_name_english() -> &'static str
fn type_name_english() -> &'static str
Returns the English type name. Read more
Source§impl<'de> Deserialize<'de> for Quantity
impl<'de> Deserialize<'de> for Quantity
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
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 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