pub trait Bo4eEnum:
Sealed
+ Copy
+ Sized
+ 'static {
const VARIANTS: &'static [Self];
const COUNT: usize;
// Required methods
fn as_wire(&self) -> &'static str;
fn from_wire(s: &str) -> Result<Self, UnknownVariant>;
fn is_unknown(&self) -> bool;
// Provided method
fn is_known(&self) -> bool { ... }
}versioned only.Expand description
Uniform introspection & strict-parsing surface implemented by every
generated BO4E enum (Zaehlertyp, Marktrolle, BdewArtikelnummer, …).
Every BO4E enum carries an Unknown catch-all, so the serde / FromStr
path never fails on an unrecognized wire value — right for forward
compatibility, wrong at an ingest boundary. These members close that gap
without the strum feature.
They are inherent methods too, so importing the trait matters only for code generic over the enum type.
§Example
use rubo4e::{current::Zaehlertyp, Bo4eEnum};
// Introspection without `strum`:
assert_eq!(Zaehlertyp::COUNT, Zaehlertyp::VARIANTS.len());
// Strict parsing at the ingest boundary:
assert_eq!(Zaehlertyp::from_wire("WASSERZAEHLER"), Ok(Zaehlertyp::Wasserzaehler));
assert!(Zaehlertyp::from_wire("NOT_A_REAL_VALUE").is_err());
// Detect lenient-decode fall-through:
let z: Zaehlertyp = serde_json::from_str("\"BOGUS\"").unwrap();
assert!(z.is_unknown());§Derived traits on every BO4E enum
Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash.
Ord is declaration order, not a business ranking — schema order, with
Unknown last. Total, so BTreeMap and sort() work, but a schema release
may reorder the values: never persist a sort key derived from it. Compare
as_wire where the order must be stable.
§Sealed trait
Bo4eEnum is sealed — it cannot be implemented outside this crate.
Required Associated Constants§
Required Methods§
Sourcefn as_wire(&self) -> &'static str
fn as_wire(&self) -> &'static str
Returns the canonical BO4E wire string (SCREAMING_SNAKE_CASE) for this value.
Sourcefn from_wire(s: &str) -> Result<Self, UnknownVariant>
fn from_wire(s: &str) -> Result<Self, UnknownVariant>
Strictly parses a BO4E wire string, returning
Err for any value not defined in this
schema version — including the literal "UNKNOWN".
This is the opt-in strict counterpart to the lenient serde / FromStr
path, which maps unrecognized values to the Unknown catch-all.
Sourcefn is_unknown(&self) -> bool
fn is_unknown(&self) -> bool
Returns true if this value is the forward-compatibility Unknown
catch-all — i.e. an out-of-schema value produced by a lenient decode.
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
Source§impl Bo4eEnum for Abwicklungsmodell
Available on crate features json or versioned only.
impl Bo4eEnum for Abwicklungsmodell
json or versioned only.Source§impl Bo4eEnum for Aggregationsverantwortung
Available on crate features json or versioned only.
impl Bo4eEnum for Aggregationsverantwortung
json or versioned only.Source§impl Bo4eEnum for Angebotsstatus
Available on crate features json or versioned only.
impl Bo4eEnum for Angebotsstatus
json or versioned only.Source§impl Bo4eEnum for AufAbschlagstyp
Available on crate features json or versioned only.
impl Bo4eEnum for AufAbschlagstyp
json or versioned only.Source§impl Bo4eEnum for AufAbschlagsziel
Available on crate features json or versioned only.
impl Bo4eEnum for AufAbschlagsziel
json or versioned only.Source§impl Bo4eEnum for Ausschreibungsportal
Available on crate features json or versioned only.
impl Bo4eEnum for Ausschreibungsportal
json or versioned only.Source§impl Bo4eEnum for Ausschreibungsstatus
Available on crate features json or versioned only.
impl Bo4eEnum for Ausschreibungsstatus
json or versioned only.Source§impl Bo4eEnum for Ausschreibungstyp
Available on crate features json or versioned only.
impl Bo4eEnum for Ausschreibungstyp
json or versioned only.Source§impl Bo4eEnum for BdewArtikelnummer
Available on crate features json or versioned only.
impl Bo4eEnum for BdewArtikelnummer
json or versioned only.Source§impl Bo4eEnum for Befestigungsart
Available on crate features json or versioned only.
impl Bo4eEnum for Befestigungsart
json or versioned only.Source§impl Bo4eEnum for Bemessungsgroesse
Available on crate features json or versioned only.
impl Bo4eEnum for Bemessungsgroesse
json or versioned only.Source§impl Bo4eEnum for Bilanzierungsmethode
Available on crate features json or versioned only.
impl Bo4eEnum for Bilanzierungsmethode
json or versioned only.Source§impl Bo4eEnum for Dienstleistungstyp
Available on crate features json or versioned only.
impl Bo4eEnum for Dienstleistungstyp
json or versioned only.Source§impl Bo4eEnum for EMobilitaetsart
Available on crate features json or versioned only.
impl Bo4eEnum for EMobilitaetsart
json or versioned only.Source§impl Bo4eEnum for Energierichtung
Available on crate features json or versioned only.
impl Bo4eEnum for Energierichtung
json or versioned only.Source§impl Bo4eEnum for Erzeugungsart
Available on crate features json or versioned only.
impl Bo4eEnum for Erzeugungsart
json or versioned only.Source§impl Bo4eEnum for Fallgruppenzuordnung
Available on crate features json or versioned only.
impl Bo4eEnum for Fallgruppenzuordnung
json or versioned only.Source§impl Bo4eEnum for Gasqualitaet
Available on crate features json or versioned only.
impl Bo4eEnum for Gasqualitaet
json or versioned only.Source§impl Bo4eEnum for Geraeteklasse
Available on crate features json or versioned only.
impl Bo4eEnum for Geraeteklasse
json or versioned only.Source§impl Bo4eEnum for Geraetetyp
Available on crate features json or versioned only.
impl Bo4eEnum for Geraetetyp
json or versioned only.Source§impl Bo4eEnum for Geschaeftspartnerrolle
Available on crate features json or versioned only.
impl Bo4eEnum for Geschaeftspartnerrolle
json or versioned only.Source§impl Bo4eEnum for Kalkulationsmethode
Available on crate features json or versioned only.
impl Bo4eEnum for Kalkulationsmethode
json or versioned only.Source§impl Bo4eEnum for Kontaktart
Available on crate features json or versioned only.
impl Bo4eEnum for Kontaktart
json or versioned only.Source§impl Bo4eEnum for Kostenklasse
Available on crate features json or versioned only.
impl Bo4eEnum for Kostenklasse
json or versioned only.Source§impl Bo4eEnum for Kundengruppe
Available on crate features json or versioned only.
impl Bo4eEnum for Kundengruppe
json or versioned only.Source§impl Bo4eEnum for KundengruppeKa
Available on crate features json or versioned only.
impl Bo4eEnum for KundengruppeKa
json or versioned only.Source§impl Bo4eEnum for Landescode
Available on crate features json or versioned only.
impl Bo4eEnum for Landescode
json or versioned only.Source§impl Bo4eEnum for Leistungstyp
Available on crate features json or versioned only.
impl Bo4eEnum for Leistungstyp
json or versioned only.Source§impl Bo4eEnum for Marktrolle
Available on crate features json or versioned only.
impl Bo4eEnum for Marktrolle
json or versioned only.Source§impl Bo4eEnum for Mengeneinheit
Available on crate features json or versioned only.
impl Bo4eEnum for Mengeneinheit
json or versioned only.Source§impl Bo4eEnum for Messgroesse
Available on crate features json or versioned only.
impl Bo4eEnum for Messgroesse
json or versioned only.Source§impl Bo4eEnum for Messpreistyp
Available on crate features json or versioned only.
impl Bo4eEnum for Messpreistyp
json or versioned only.Source§impl Bo4eEnum for Messwertstatus
Available on crate features json or versioned only.
impl Bo4eEnum for Messwertstatus
json or versioned only.Source§impl Bo4eEnum for Messwertstatuszusatz
Available on crate features json or versioned only.
impl Bo4eEnum for Messwertstatuszusatz
json or versioned only.Source§impl Bo4eEnum for NetznutzungRechnungsart
Available on crate features json or versioned only.
impl Bo4eEnum for NetznutzungRechnungsart
json or versioned only.Source§impl Bo4eEnum for NetznutzungRechnungstyp
Available on crate features json or versioned only.
impl Bo4eEnum for NetznutzungRechnungstyp
json or versioned only.Source§impl Bo4eEnum for Oekozertifikat
Available on crate features json or versioned only.
impl Bo4eEnum for Oekozertifikat
json or versioned only.Source§impl Bo4eEnum for Organisationstyp
Available on crate features json or versioned only.
impl Bo4eEnum for Organisationstyp
json or versioned only.Source§impl Bo4eEnum for Preisgarantietyp
Available on crate features json or versioned only.
impl Bo4eEnum for Preisgarantietyp
json or versioned only.Source§impl Bo4eEnum for Preismodell
Available on crate features json or versioned only.
impl Bo4eEnum for Preismodell
json or versioned only.Source§impl Bo4eEnum for Preisreferenz
Available on crate features json or versioned only.
impl Bo4eEnum for Preisreferenz
json or versioned only.Source§impl Bo4eEnum for Preisstatus
Available on crate features json or versioned only.
impl Bo4eEnum for Preisstatus
json or versioned only.Source§impl Bo4eEnum for Profilverfahren
Available on crate features json or versioned only.
impl Bo4eEnum for Profilverfahren
json or versioned only.Source§impl Bo4eEnum for Prognosegrundlage
Available on crate features json or versioned only.
impl Bo4eEnum for Prognosegrundlage
json or versioned only.Source§impl Bo4eEnum for Rechnungslegung
Available on crate features json or versioned only.
impl Bo4eEnum for Rechnungslegung
json or versioned only.Source§impl Bo4eEnum for Rechnungsstatus
Available on crate features json or versioned only.
impl Bo4eEnum for Rechnungsstatus
json or versioned only.Source§impl Bo4eEnum for Rechnungstyp
Available on crate features json or versioned only.
impl Bo4eEnum for Rechnungstyp
json or versioned only.Source§impl Bo4eEnum for Regionskriterium
Available on crate features json or versioned only.
impl Bo4eEnum for Regionskriterium
json or versioned only.Source§impl Bo4eEnum for Registeranzahl
Available on crate features json or versioned only.
impl Bo4eEnum for Registeranzahl
json or versioned only.Source§impl Bo4eEnum for Rollencodetyp
Available on crate features json or versioned only.
impl Bo4eEnum for Rollencodetyp
json or versioned only.Source§impl Bo4eEnum for Speicherart
Available on crate features json or versioned only.
impl Bo4eEnum for Speicherart
json or versioned only.Source§impl Bo4eEnum for SteuerkanalLeistungsbeschreibung
Available on crate features json or versioned only.
impl Bo4eEnum for SteuerkanalLeistungsbeschreibung
json or versioned only.Source§impl Bo4eEnum for Tarifkalkulationsmethode
Available on crate features json or versioned only.
impl Bo4eEnum for Tarifkalkulationsmethode
json or versioned only.Source§impl Bo4eEnum for Tarifmerkmal
Available on crate features json or versioned only.
impl Bo4eEnum for Tarifmerkmal
json or versioned only.Source§impl Bo4eEnum for TechnischeRessourceNutzung
Available on crate features json or versioned only.
impl Bo4eEnum for TechnischeRessourceNutzung
json or versioned only.Source§impl Bo4eEnum for TechnischeRessourceVerbrauchsart
Available on crate features json or versioned only.
impl Bo4eEnum for TechnischeRessourceVerbrauchsart
json or versioned only.Source§impl Bo4eEnum for Themengebiet
Available on crate features json or versioned only.
impl Bo4eEnum for Themengebiet
json or versioned only.Source§impl Bo4eEnum for Verbrauchsart
Available on crate features json or versioned only.
impl Bo4eEnum for Verbrauchsart
json or versioned only.Source§impl Bo4eEnum for Vertragsart
Available on crate features json or versioned only.
impl Bo4eEnum for Vertragsart
json or versioned only.Source§impl Bo4eEnum for Vertragsform
Available on crate features json or versioned only.
impl Bo4eEnum for Vertragsform
json or versioned only.Source§impl Bo4eEnum for Vertragsstatus
Available on crate features json or versioned only.
impl Bo4eEnum for Vertragsstatus
json or versioned only.Source§impl Bo4eEnum for Verwendungszweck
Available on crate features json or versioned only.
impl Bo4eEnum for Verwendungszweck
json or versioned only.Source§impl Bo4eEnum for Voraussetzungen
Available on crate features json or versioned only.
impl Bo4eEnum for Voraussetzungen
json or versioned only.Source§impl Bo4eEnum for Waehrungscode
Available on crate features json or versioned only.
impl Bo4eEnum for Waehrungscode
json or versioned only.Source§impl Bo4eEnum for Waehrungseinheit
Available on crate features json or versioned only.
impl Bo4eEnum for Waehrungseinheit
json or versioned only.Source§impl Bo4eEnum for WahlrechtPrognosegrundlage
Available on crate features json or versioned only.
impl Bo4eEnum for WahlrechtPrognosegrundlage
json or versioned only.Source§impl Bo4eEnum for Wiederholungstyp
Available on crate features json or versioned only.
impl Bo4eEnum for Wiederholungstyp
json or versioned only.Source§impl Bo4eEnum for Zaehlerauspraegung
Available on crate features json or versioned only.
impl Bo4eEnum for Zaehlerauspraegung
json or versioned only.Source§impl Bo4eEnum for Zaehlergroesse
Available on crate features json or versioned only.
impl Bo4eEnum for Zaehlergroesse
json or versioned only.Source§impl Bo4eEnum for Zaehlertyp
Available on crate features json or versioned only.
impl Bo4eEnum for Zaehlertyp
json or versioned only.Source§impl Bo4eEnum for ZaehlertypSpezifikation
Available on crate features json or versioned only.
impl Bo4eEnum for ZaehlertypSpezifikation
json or versioned only.Source§impl Bo4eEnum for Zahlungsart
Available on crate features json or versioned only.
impl Bo4eEnum for Zahlungsart
json or versioned only.