pub struct PriceRule {
pub energy_fee: RationalNumber,
pub power_range_start: RationalNumber,
pub parking_fee_period: Option<i32>,
pub carbon_dioxide_emission: Option<i32>,
pub renewable_generation_percentage: Option<i32>,
pub parking_fee: Option<RationalNumber>,
pub custom_data: Option<CustomData>,
}Expand description
Part of ISO 15118-20 price schedule.
The OCPP 2.1 PriceRule data type.
Fields§
§energy_fee: RationalNumberThe energyFee member.
power_range_start: RationalNumberThe powerRangeStart member.
parking_fee_period: Option<i32>The duration of the parking fee period (in seconds). When the time enters into a ParkingFeePeriod, the ParkingFee will apply to the session. .
carbon_dioxide_emission: Option<i32>Number of grams of CO2 per kWh.
renewable_generation_percentage: Option<i32>Percentage of the power that is created by renewable resources.
parking_fee: Option<RationalNumber>The parkingFee member.
custom_data: Option<CustomData>The customData member.
Implementations§
Source§impl PriceRule
impl PriceRule
Sourcepub fn new(
energy_fee: RationalNumber,
power_range_start: RationalNumber,
) -> Self
pub fn new( energy_fee: RationalNumber, power_range_start: RationalNumber, ) -> Self
Creates a PriceRule from its required fields.
Sourcepub fn with_parking_fee_period(self, value: i32) -> Self
pub fn with_parking_fee_period(self, value: i32) -> Self
Sets the optional parkingFeePeriod field.
Sourcepub fn with_carbon_dioxide_emission(self, value: i32) -> Self
pub fn with_carbon_dioxide_emission(self, value: i32) -> Self
Sets the optional carbonDioxideEmission field.
Sourcepub fn with_renewable_generation_percentage(self, value: i32) -> Self
pub fn with_renewable_generation_percentage(self, value: i32) -> Self
Sets the optional renewableGenerationPercentage field.
Sourcepub fn with_parking_fee(self, value: RationalNumber) -> Self
pub fn with_parking_fee(self, value: RationalNumber) -> Self
Sets the optional parkingFee 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 PriceRule
impl<'de> Deserialize<'de> for PriceRule
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 PriceRule
Source§impl Validate for PriceRule
impl Validate for PriceRule
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 PriceRule
impl Freeze for PriceRule
impl Move for PriceRule
impl RefUnwindSafe for PriceRule
impl Send for PriceRule
impl Sync for PriceRule
impl Unpin for PriceRule
impl UnsafeUnpin for PriceRule
impl UnwindSafe for PriceRule
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