Skip to main content

EmobError

Enum EmobError 

Source
#[non_exhaustive]
pub enum EmobError { NotFirstOfMonth { was: &'static str, date: Date, }, DoppeltesBilanzierungsgebiet { regelzone: String, }, AnmeldungVorBgBeginn { anmeldung: Date, bg_start: Date, }, AnmeldungNachBgEnde { anmeldung: Date, bg_ende: Date, }, EegAnlageAusserhalbDesBeschlusses, KeineViertelstundenmessung, ErhaltungVerletzt { slot: String, ngz: Decimal, summe: Decimal, delta: Decimal, }, VersionIstFinal { erstellungszeitpunkt: String, }, KorrekturfristAbgelaufen { monat: String, frist: Date, eingang: Date, }, DoppelterAnspruch { malo: String, }, LadevorgangZuLang { id: String, slots: u64, max: u64, }, Allocation(String), }
Expand description

An invariant of Anlage 6 / the AWH „Zum Modell 2“ that the caller’s data breaks.

Every variant names the clause it enforces. None of them is a wire error: this crate does no I/O, so all of these are statements about the operator’s own records.

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

NotFirstOfMonth

A Bilanzierungsgebiet may begin, change or end only on the first of a month (AWH Kap. 5.3.1.3: „Die Bildung und Änderung von einem BG erfolgt nur zum Ersten eines Monats“).

Fields

§was: &'static str

Which lifecycle instant was wrong.

§date: Date

The date the caller supplied.

§

DoppeltesBilanzierungsgebiet

A Ladepunktbetreiber holds at most one Bilanzierungsgebiet per Regelzone (AWH Kap. 5.3).

Fields

§regelzone: String

The Regelzone that already has one.

§

AnmeldungVorBgBeginn

The Übergabestelle’s Anmeldedatum precedes the BG’s Gültigkeitsbeginn (AWH Kap. 2.1.2 Nr. 1: „Das Anmeldedatum darf nicht vor dem Gültigkeitsbeginn des BG liegen“).

Fields

§anmeldung: Date

The requested Anmeldedatum.

§bg_start: Date

The BG’s Gültigkeitsbeginn.

§

AnmeldungNachBgEnde

The Anmeldedatum falls on or after the day the BG stops being valid.

The AWH states only the lower bound, because a BG that has been beendet is not a BG one can register against at all: a Marktlokation balanced into an expired Bilanzierungsgebiet has no Bilanzkreis- Zuordnung on the day it takes effect, and the BIKO has nothing to settle it against (AWH Kap. 5.3.1.3, Anlage 6 §II).

Fields

§anmeldung: Date

The requested Anmeldedatum.

§bg_ende: Date

The first day the BG is no longer valid.

§

EegAnlageAusserhalbDesBeschlusses

A Kundenanlage carrying an EEG-geförderte Anlage was onboarded on the BK6-24-267 path.

The Beschluss is explicit that its scope excludes „Kundenanlagen mit EEG-geförderten Anlagen oder anderweitig komplexen Strukturen“ (S. 28). It does not decide the case either way, so the model cannot be applied to it without a bilateral agreement — and applying it anyway would balance an EEG-vergütete Einspeisung into the LPB’s BG.

§

KeineViertelstundenmessung

The Übergabestelle is not quarter-hour metered.

Anlage 6 §III.1 makes ¼-h measurement — a Zählerstandsgang or registrierende Leistungsmessung — a precondition of the model. Without it there is nothing to allocate against.

§

ErhaltungVerletzt

The conservation identity of Anlage 6 §IV.1 does not hold.

Raised only where it is a bug — a caller that assembled a version by hand and got the arithmetic wrong. The ordinary shortfall is not this: it is the Deltamenge, which is a quantity with a Bilanzkreis of its own.

Fields

§slot: String

The quarter hour, as an RFC 3339 instant.

§ngz: Decimal

The Netzgangzeitreihe value.

§summe: Decimal

What the parts add up to.

§delta: Decimal

The Deltamenge that was recorded.

§

VersionIstFinal

A version already sealed as Final was edited.

MaBiS Kap. 3.8.2 versions by Erstellungszeitpunkt; once a version has settled it is immutable and a correction is a new version.

Fields

§erstellungszeitpunkt: String

The sealed version’s Erstellungszeitpunkt.

§

KorrekturfristAbgelaufen

A correction arrived after the MaBiS Korrekturfrist.

MaBiS Kap. 3.10 closes the window at the end of month M+7 relative to the Bilanzierungsmonat.

Fields

§monat: String

The Bilanzierungsmonat, as YYYY-MM.

§frist: Date

The last day corrections were accepted.

§eingang: Date

When the correction arrived.

§

DoppelterAnspruch

Two claims in one quarter hour name the same virtual Marktlokation.

Refused rather than summed. A MaLo appearing twice produces two crate::allocation::Zuordnung rows for one Bilanzkreis-Zuordnung, and every downstream consumer that keys by MaLo — the BK-SZR aggregation above all — silently keeps one of them. Merge the claims upstream, where the reason they are two is still known.

Fields

§malo: String

The Marktlokation that appears more than once.

§

LadevorgangZuLang

A Ladevorgang spans more quarter hours than a session can.

Not a regulatory bound but a corruption guard: the split walks one slot at a time, so an ende that a backend got wrong by a factor of a thousand would otherwise allocate until the process dies. A year of quarter hours is already three orders of magnitude past the longest real charging session.

Fields

§id: String

The session’s own id.

§slots: u64

How many quarter hours it would span.

§max: u64

The most a session may span.

§

Allocation(String)

The allocation could not be formed at all.

Trait Implementations§

Source§

impl Clone for EmobError

Source§

fn clone(&self) -> EmobError

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 EmobError

Source§

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

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

impl Display for EmobError

Source§

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

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

impl Eq for EmobError

Source§

impl Error for EmobError

1.30.0 · Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<AllocationError> for EmobError

Source§

fn from(e: AllocationError) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for EmobError

Source§

fn eq(&self, other: &EmobError) -> 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 EmobError

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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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, O> Matches<O> for T
where T: PartialEq<O>,

Source§

fn validate_matches(&self, other: &O) -> bool

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToCompactString for T
where T: Display,

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.
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