pub struct SampledValue {
pub value: Decimal,
pub measurand: Option<Measurand>,
pub context: Option<ReadingContext>,
pub phase: Option<Phase>,
pub location: Option<Location>,
pub signed_meter_value: Option<SignedMeterValue>,
pub unit_of_measure: Option<UnitOfMeasure>,
pub custom_data: Option<CustomData>,
}Expand description
Single sampled value in MeterValues. Each value can be accompanied by optional fields.
To save on mobile data usage, default values of all of the optional fields are such that. The value without any additional fields will be interpreted, as a register reading of active import energy in Wh (Watt-hour) units.
The OCPP 2.1 SampledValue data type.
Fields§
§value: DecimalIndicates the measured value.
measurand: Option<Measurand>The measurand member.
context: Option<ReadingContext>The context member.
phase: Option<Phase>The phase member.
location: Option<Location>The location member.
signed_meter_value: Option<SignedMeterValue>The signedMeterValue member.
unit_of_measure: Option<UnitOfMeasure>The unitOfMeasure member.
custom_data: Option<CustomData>The customData member.
Implementations§
Source§impl SampledValue
impl SampledValue
Sourcepub fn with_measurand(self, value: Measurand) -> Self
pub fn with_measurand(self, value: Measurand) -> Self
Sets the optional measurand field.
Sourcepub fn with_context(self, value: ReadingContext) -> Self
pub fn with_context(self, value: ReadingContext) -> Self
Sets the optional context field.
Sourcepub fn with_phase(self, value: Phase) -> Self
pub fn with_phase(self, value: Phase) -> Self
Sets the optional phase field.
Sourcepub fn with_location(self, value: Location) -> Self
pub fn with_location(self, value: Location) -> Self
Sets the optional location field.
Sourcepub fn with_signed_meter_value(self, value: SignedMeterValue) -> Self
pub fn with_signed_meter_value(self, value: SignedMeterValue) -> Self
Sets the optional signedMeterValue field.
Sourcepub fn with_unit_of_measure(self, value: UnitOfMeasure) -> Self
pub fn with_unit_of_measure(self, value: UnitOfMeasure) -> Self
Sets the optional unitOfMeasure 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 Clone for SampledValue
impl Clone for SampledValue
Source§fn clone(&self) -> SampledValue
fn clone(&self) -> SampledValue
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SampledValue
impl Debug for SampledValue
Source§impl<'de> Deserialize<'de> for SampledValue
impl<'de> Deserialize<'de> for SampledValue
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>,
Source§impl PartialEq for SampledValue
impl PartialEq for SampledValue
Source§impl Serialize for SampledValue
impl Serialize for SampledValue
impl StructuralPartialEq for SampledValue
Source§impl Validate for SampledValue
impl Validate for SampledValue
Source§fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations)
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations)
out, relative to path.