Skip to main content

MeterInput

Struct MeterInput 

Source
pub struct MeterInput {
Show 13 fields pub arbeitsmenge_kwh: Decimal, pub arbeitsmenge_ht_kwh: Option<Decimal>, pub arbeitsmenge_nt_kwh: Option<Decimal>, pub spitzenleistung_kw: Option<Decimal>, pub steuerung_stunden: Option<Decimal>, pub zaehlernummer: Option<String>, pub zaehlerstand_von: Option<Decimal>, pub zaehlerstand_bis: Option<Decimal>, pub metering_mode: MeteringMode, pub ablesungsart: Ablesungsart, pub is_estimated: bool, pub zaehler_replaced: bool, pub coverage_pct: Option<Decimal>,
}
Expand description

Electricity meter data for one billing period.

Fields§

§arbeitsmenge_kwh: Decimal

Total energy in kWh (Arbeitsmenge).

§arbeitsmenge_ht_kwh: Option<Decimal>

High-tariff energy in kWh (HT, for Zweitarif). None = single tariff.

§arbeitsmenge_nt_kwh: Option<Decimal>

Low-tariff energy in kWh (NT, for Zweitarif). None = single tariff.

§spitzenleistung_kw: Option<Decimal>

Peak demand in kW (Spitzenleistung, § 12 StromNZV).

§steuerung_stunden: Option<Decimal>

§14a EnWG: hours the controllable device was under NB management.

§zaehlernummer: Option<String>

Zählernummer (§41 EnWG — mandatory on electricity invoices).

When set, appears as an informational position on the invoice. Overrides BillingContext::zaehler_id for this specific meter.

§zaehlerstand_von: Option<Decimal>

Zählerstand at the start of the billing period.

§41 EnWG: billing invoices must show the meter reading at period start.

§zaehlerstand_bis: Option<Decimal>

Zählerstand at the end of the billing period.

§41 EnWG: billing invoices must show the meter reading at period end.

§metering_mode: MeteringMode

Metering mode — SLP, RLM, or iMSys (Smart Meter).

Used to validate tariff compatibility (§41a requires Imsys) and to label estimated readings correctly on the invoice.

§ablesungsart: Ablesungsart

§ 40 Abs. 2 Nr. 6 EnWG — how the reading was obtained.

See also MeterInput::billable_kwh, which is what decides whether there is any consumption to price.

Stated on the invoice beside the readings themselves. Rechnerisch implies Self::is_estimated; the two are kept separate because a caller that knows only “this is an estimate” can still say so.

§is_estimated: bool

true when the consumption figure is an estimate rather than a reading — either a § 40a Abs. 2 EnWG Verbrauchsschätzung or an Ersatzwert the Messstellenbetreiber formed and passed on under § 40a Abs. 1 Satz 1 Nr. 1 EnWG.

§ 40a Abs. 2 Satz 3 EnWG has the invoice state the estimate, the ground that makes it admissible and the factors behind it „unter ausdrücklichem und optisch besonders hervorgehobenem Hinweis“.

§zaehler_replaced: bool

true when the meter was replaced during this billing period (Zählerwechsel).

When set, zaehlerstand_von / zaehlerstand_bis may relate to different meter serial numbers. The invoice must note the meter exchange.

§coverage_pct: Option<Decimal>

Share of the billing period covered by billable readings, 0–100.

A sum over the readings that did arrive says nothing about the ones that did not: a month delivered up to the 3rd sums to a plausible Arbeitsmenge and bills as a complete month. Below 100 the invoice rests in part on a § 40a Abs. 2 EnWG Verbrauchsschätzung, which the document has to say so prominently — the MENGE_UNVOLLSTAENDIG finding carries that.

None when the source states no coverage.

Implementations§

Source§

impl MeterInput

Source

pub fn billable_kwh(&self) -> Decimal

The consumption there is to price, in kWh.

arbeitsmenge_kwh where it is stated, otherwise the HT/NT registers. A Zweitarif caller may legitimately supply only the split — the total is its sum, not an independent fact — and gating the whole Arbeitspreis block on the total alone billed such a customer nothing for their electricity while still charging them the Stromsteuer.

Trait Implementations§

Source§

impl Clone for MeterInput

Source§

fn clone(&self) -> MeterInput

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 Debug for MeterInput

Source§

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

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

impl Default for MeterInput

Source§

fn default() -> MeterInput

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for MeterInput

Source§

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 Serialize for MeterInput

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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, 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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more