pub struct Price {
pub meta: Bo4eMeta,
pub value: Option<f64>,
pub currency: Option<Currency>,
pub reference_unit: Option<Unit>,
pub price_type: Option<PriceType>,
pub status: Option<PriceStatus>,
}Expand description
A price with value, currency, and unit.
German: Preis
§Example
use bo4e_core::com::Price;
use bo4e_core::enums::{Currency, Unit};
let price = Price {
value: Some(0.25),
currency: Some(Currency::Eur),
reference_unit: Some(Unit::KilowattHour),
..Default::default()
};Fields§
§meta: Bo4eMetaBO4E metadata
value: Option<f64>Price value (Wert)
currency: Option<Currency>Currency (Waehrung)
reference_unit: Option<Unit>Unit that the price applies to (Bezugswert)
price_type: Option<PriceType>Type of price (Preistyp)
status: Option<PriceStatus>Status of the price (Preisstatus)
Implementations§
Source§impl Price
impl Price
Sourcepub fn eur_per_kwh(value: f64) -> Self
pub fn eur_per_kwh(value: f64) -> Self
Create a price in EUR per kWh.
Sourcepub fn eur_per_month(value: f64) -> Self
pub fn eur_per_month(value: f64) -> Self
Create a price in EUR per month (base price).
Trait Implementations§
Source§impl Bo4eObject for Price
impl Bo4eObject for Price
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 Price
impl<'de> Deserialize<'de> for Price
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 Price
Auto Trait Implementations§
impl Freeze for Price
impl RefUnwindSafe for Price
impl Send for Price
impl Sync for Price
impl Unpin for Price
impl UnwindSafe for Price
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