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

Single sampled value in MeterValues. Each value can be accompanied by optional fields.

Fields

value: String

Required. Value as a “Raw” (decimal) number or “SignedData”. Field Type is “string” to allow for digitally signed data readings. Decimal numeric values are also acceptable to allow fractional values for measurands such as Temperature and Current.

context: Option<ReadingContext>

Optional. Type of detail value: start, end or sample. Default = “Sample.Periodic”

format: Option<ValueFormat>

Optional. Raw or signed data. Default = “Raw”

measurand: Option<Measurand>

Optional. Type of measurement. Default = “Energy.Active.Import.Register”

phase: Option<Phase>

Optional. indicates how the measured value is to be interpreted. For instance between L1 and neutral (L1-N) Please note that not all values of phase are applicable to all Measurands. When phase is absent, the measured value is interpreted as an overall value.

location: Option<Location>

Optional. Location of measurement. Default=”Outlet”

unit: Option<UnitOfMeasure>

Optional. Unit of the value. Default = “Wh” if the (default) measurand is an “Energy” type.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.