Skip to main content

Modifier

Enum Modifier 

Source
#[non_exhaustive]
pub enum Modifier {
Show 30 variants Error(RecordError), Average, CompactProfile(Direction), RelativeDeviation, StandardConformant, Per(Per), IncrementPerPulse { output: bool, channel: u8, }, MultipliedBy(Times), StartDateOf, UncorrectedUnit, Forward, Backward, NonMetric, BaseConditions, ObisDeclaration, Limit { upper: bool, }, ExceedCount { upper: bool, }, LimitExceedDate { upper: bool, last: bool, end: bool, }, LimitExceedDuration { upper: bool, last: bool, unit: Unit, }, Duration { last: bool, unit: Unit, }, ValueDuringLimitExceed { upper: bool, }, Leakage, Overflow, DateOf { last: bool, end: bool, }, Scale(i8), Offset(i8), Extension(Extension), FutureValue, ManufacturerSpecific, Reserved(u8),
}
Expand description

One combinable (orthogonal) VIFE: how it modifies the value (EN 13757-3, Table 15).

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Error(RecordError)

00–11, 15–1C: the slave reports an error for this record.

§

Average

12: an average value.

§

CompactProfile(Direction)

13, 1E, 1F: the record is a compact profile (see Record::profile).

§

RelativeDeviation

14: a relative deviation.

§

StandardConformant

1D: standard-conformant data content (e.g. error flags as defined by OMS).

§

Per(Per)

20–27, 2C–35: the value is per this denominator.

§

IncrementPerPulse

28–2B: increment per input or output pulse on channel 0 or 1.

Fields

§output: bool

Output (true) or input channel.

§channel: u8

Channel 0 or 1.

§

MultipliedBy(Times)

36–38: the value is multiplied by this.

§

StartDateOf

39: the value is the start date (and time) of what the VIF describes.

§

UncorrectedUnit

3A: the VIF is the uncorrected unit (e.g. volume at measuring conditions).

§

Forward

3B: forward flow: accumulation of positive contributions only.

§

Backward

3C: backward flow: accumulation of the absolute value of negative contributions only.

§

NonMetric

3D: an alternate, non-metric unit system.

§

BaseConditions

3E: the value at base conditions.

§

ObisDeclaration

3F: OBIS declaration.

§

Limit

40 / 48: a lower or upper limit value.

Fields

§upper: bool

Upper (true) or lower limit.

§

ExceedCount

41 / 49: the number of times the lower or upper limit was exceeded.

Fields

§upper: bool

Upper (true) or lower limit.

§

LimitExceedDate

42–4F (E100 uf1b): the date (and time) a limit exceed began or ended.

Fields

§upper: bool

Upper (true) or lower limit.

§last: bool

Last (true) or first exceed.

§end: bool

End (true) or beginning.

§

LimitExceedDuration

50–5F (E101 ufnn): how long a limit was exceeded.

Fields

§upper: bool

Upper (true) or lower limit.

§last: bool

Last (true) or first exceed.

§unit: Unit

Seconds, minutes, hours or days.

§

Duration

60–67 (E110 0fnn): a duration.

Fields

§last: bool

Last (true) or first.

§unit: Unit

Seconds, minutes, hours or days.

§

ValueDuringLimitExceed

68 / 6C: the value during a lower or upper limit exceed.

Fields

§upper: bool

Upper (true) or lower limit.

§

Leakage

69: leakage values.

§

Overflow

6D: overflow values.

§

DateOf

6A, 6B, 6E, 6F (E110 1f1b): the date (and time) of a first or last beginning or end.

Fields

§last: bool

Last (true) or first.

§end: bool

End (true) or beginning.

§

Scale(i8)

70–77 (×10^(nnn−6)) and 7D (×10³): multiplicative correction, applied by Record::quantity.

§

Offset(i8)

78–7B: the record is an additive correction constant (offset) of 10^(nn−3) × the VIF’s unit.

§

Extension(Extension)

FC and the code after it: from the extension of the combinable table.

§

FutureValue

7E: a future value.

§

ManufacturerSpecific

7F: this and every following VIFE (and the data) are manufacturer-specific.

§

Reserved(u8)

A code the table reserves.

Implementations§

Source§

impl Modifier

Source

pub const fn keeps_quantity(self) -> bool

Whether Record::quantity may still report the value in the VIF’s unit: the modifier scales it (applied) or annotates it without changing unit or meaning.

Source

pub const fn name(self) -> &'static str

A short English description, e.g. "per hour".

Trait Implementations§

Source§

impl Clone for Modifier

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Modifier

Source§

impl Debug for Modifier

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for Modifier

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for Modifier

Source§

impl Hash for Modifier

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for Modifier

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Modifier

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.