ocpp/v1_6/datatype/sampled_value
OCPP 1.6 SampledValue data type.
to_json/decoder map to/from its OCPP-J JSON object; new (when
present) builds a value from the required fields only.
Types
| Field | Type | Req | Description |
|---|---|---|---|
context | ReadingContext | — | |
format | ValueFormat | — | |
location | Location | — | |
measurand | Measurand | — | |
phase | Phase | — | |
unit | UnitOfMeasure | — | |
value | String | ✓ |
Schema: SampledValue
pub type SampledValue {
SampledValue(
context: option.Option(reading_context.ReadingContext),
format: option.Option(value_format.ValueFormat),
location: option.Option(location.Location),
measurand: option.Option(measurand.Measurand),
phase: option.Option(phase.Phase),
unit: option.Option(unit_of_measure.UnitOfMeasure),
value: String,
)
}
Constructors
-
SampledValue( context: option.Option(reading_context.ReadingContext), format: option.Option(value_format.ValueFormat), location: option.Option(location.Location), measurand: option.Option(measurand.Measurand), phase: option.Option(phase.Phase), unit: option.Option(unit_of_measure.UnitOfMeasure), value: String, )
Values
pub fn decoder() -> decode.Decoder(SampledValue)
Decode a SampledValue from its OCPP-J JSON object, enforcing schema constraints.
pub fn new(value value: String) -> SampledValue
Construct a SampledValue from its required fields, with every optional field set to None.
pub fn to_json(value: SampledValue) -> json.Json
Encode a SampledValue to its OCPP-J JSON object.