Skip to main content

ArbeitspreisModell

Enum ArbeitspreisModell 

Source
pub enum ArbeitspreisModell {
    Einheitlich(MengePreis),
    Modul1Pauschal {
        basis: MengePreis,
        reduktion: Reduktionsfaktor,
    },
    Modul2ZeitVariabel {
        ht: MengePreis,
        nt: MengePreis,
    },
    Modul3Spotpreis {
        intervalle: Vec<Sect14aModul3Interval>,
    },
}
Expand description

How the Arbeitspreis is structured, and whether §14a applies.

One enum rather than three independent field groups. The four variants are mutually exclusive by construction, which removes a whole class of defect:

  • The four HT/NT fields were 2⁴ states of which two were valid. Setting three of them fell through to flat billing with no error — the invoice looked right and was billed on the wrong basis.
  • Modul 1 and Modul 3 could both be set. The engine applied the flat reduction and the per-interval rates, double-billing the same energy.
  • Modul 1 and Modul 2 could both be set; the engine silently preferred Modul 2 rather than rejecting the conflict.

Those were runtime warnings in a validator the engine never called. They are now unrepresentable.

Variants§

§

Einheitlich(MengePreis)

A single rate for all metered energy.

§

Modul1Pauschal

§14a Modul 1 — the published rate reduced by a flat factor.

BNetzA BK6-22-300 Anlage 2.

Fields

§basis: MengePreis

The metered energy and its published rate, before reduction.

§reduktion: Reduktionsfaktor

The fraction of that rate actually paid.

§

Modul2ZeitVariabel

§14a Modul 2 — time-variable rates in a Hoch-/Niedertarif split.

Both bands are required: a Modul 2 tariff has both, and permitting one would reintroduce the partial state this type exists to prevent.

Fields

§ht: MengePreis

Hochtarif band.

§nt: MengePreis

Niedertarif band.

§

Modul3Spotpreis

§14a Modul 3 — a spot-derived rate per dispatch interval.

BNetzA BK6-22-300 Anlage 2 §3. The rates arrive already derived; this crate never queries a spot market.

Fields

§intervalle: Vec<Sect14aModul3Interval>

The dispatch intervals, each with its own rate.

Implementations§

Source§

impl ArbeitspreisModell

Source

pub fn menge_kwh(&self) -> Decimal

Total metered energy across the model, in kWh.

This is the base the Konzessionsabgabe and the network levies are charged on, so it is derived here once rather than recomputed per levy.

Source

pub const fn sect14a_modul(&self) -> Option<Sect14aModule>

The §14a module in play, if any.

Trait Implementations§

Source§

impl Clone for ArbeitspreisModell

Source§

fn clone(&self) -> ArbeitspreisModell

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 ArbeitspreisModell

Source§

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

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

impl PartialEq for ArbeitspreisModell

Source§

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

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

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

Inequality operator !=. Read more
Source§

impl Serialize for ArbeitspreisModell

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
Source§

impl StructuralPartialEq for ArbeitspreisModell

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.