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

FieldTypeReqDescription
contextReadingContext
formatValueFormat
locationLocation
measurandMeasurand
phasePhase
unitUnitOfMeasure
valueString

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

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.

Search Document