pub struct Price {
pub excl_tax: Option<Decimal>,
pub incl_tax: Option<Decimal>,
pub tax_rates: Option<Vec<TaxRate>>,
pub custom_data: Option<CustomData>,
}Expand description
Price with and without tax. At least one of exclTax, inclTax must be present.
The OCPP 2.1 Price data type.
Fields§
§excl_tax: Option<Decimal>Price/cost excluding tax. Can be absent if inclTax is present.
incl_tax: Option<Decimal>Price/cost including tax. Can be absent if exclTax is present.
tax_rates: Option<Vec<TaxRate>>The taxRates member.
custom_data: Option<CustomData>The customData member.
Implementations§
Source§impl Price
impl Price
Sourcepub fn with_excl_tax(self, value: impl Into<Decimal>) -> Self
pub fn with_excl_tax(self, value: impl Into<Decimal>) -> Self
Sets the optional exclTax field.
Sourcepub fn with_incl_tax(self, value: impl Into<Decimal>) -> Self
pub fn with_incl_tax(self, value: impl Into<Decimal>) -> Self
Sets the optional inclTax field.
Sourcepub fn with_tax_rates(self, value: Vec<TaxRate>) -> Self
pub fn with_tax_rates(self, value: Vec<TaxRate>) -> Self
Sets the optional taxRates field.
Sourcepub fn with_custom_data(self, value: CustomData) -> Self
pub fn with_custom_data(self, value: CustomData) -> Self
Sets the optional customData field.
Trait Implementations§
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
Source§impl Validate for Price
impl Validate for Price
Source§fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations)
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations)
Appends this value’s violations to
out, relative to path.Auto Trait Implementations§
impl Forget for Price
impl Freeze for Price
impl Move for Price
impl RefUnwindSafe for Price
impl Send for Price
impl Sync for Price
impl Unpin for Price
impl UnsafeUnpin 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