pub struct SampledValue {
pub value: String,
pub context: Option<ReadingContext>,
pub format: Option<ValueFormat>,
pub measurand: Option<Measurand>,
pub phase: Option<Phase>,
pub location: Option<Location>,
pub unit: Option<UnitOfMeasure>,
}Expand description
The OCPP 1.6 SampledValue data type.
Fields§
§value: StringThe value member.
context: Option<ReadingContext>The context member.
format: Option<ValueFormat>The format member.
measurand: Option<Measurand>The measurand member.
phase: Option<Phase>The phase member.
location: Option<Location>The location member.
unit: Option<UnitOfMeasure>The unit member.
Implementations§
Source§impl SampledValue
impl SampledValue
Sourcepub fn with_context(self, value: ReadingContext) -> Self
pub fn with_context(self, value: ReadingContext) -> Self
Sets the optional context field.
Sourcepub fn with_format(self, value: ValueFormat) -> Self
pub fn with_format(self, value: ValueFormat) -> Self
Sets the optional format field.
Sourcepub fn with_measurand(self, value: Measurand) -> Self
pub fn with_measurand(self, value: Measurand) -> Self
Sets the optional measurand 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_unit(self, value: UnitOfMeasure) -> Self
pub fn with_unit(self, value: UnitOfMeasure) -> Self
Sets the optional unit field.
Trait Implementations§
Source§impl Clone for SampledValue
impl Clone for SampledValue
Source§fn clone(&self) -> SampledValue
fn clone(&self) -> SampledValue
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
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>,
Deserialize this value from the given Serde deserializer. Read more
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)
Appends this value’s violations to
out, relative to path.Auto Trait Implementations§
impl Freeze for SampledValue
impl RefUnwindSafe for SampledValue
impl Send for SampledValue
impl Sync for SampledValue
impl Unpin for SampledValue
impl UnsafeUnpin for SampledValue
impl UnwindSafe for SampledValue
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