#[non_exhaustive]pub enum AgencyCode {
Bdew,
Gs1,
Entso,
Dvgw,
}Expand description
EDIFACT DE 3055 — code list responsible agency for market participant identification.
Used in NAD segments (C082 component 2) and IDE segments to indicate which body issued the party identifier code. Choosing the wrong agency code produces non-conformant EDIFACT that receiving parties may reject.
In the German energy market (BDEW MaKo / EDI@Energy) the dominant code is
AgencyCode::Bdew ("293"). Nearly all supplier, DSO, and MSB codes are
issued and administered by BDEW and carry this agency qualifier — even when the
13-digit number is also a valid GS1 GLN (BDEW is a GS1 member prefix holder).
§Wire format
The agency code appears as the third component of the NAD C082 composite:
NAD+MS+{party_id}::{agency_code}'The middle component (code list id, C082/1154) is always empty in EDI@Energy.
§Example
use edi_energy::AgencyCode;
assert_eq!(AgencyCode::Bdew.as_str(), "293");
assert_eq!(AgencyCode::Gs1.as_str(), "9");
assert_eq!(AgencyCode::Entso.as_str(), "305");
// Parse from a raw NAD segment agency string.
assert_eq!(AgencyCode::parse("293"), Some(AgencyCode::Bdew));
assert_eq!(AgencyCode::parse("999"), None);Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Bdew
"293" — BDEW (Bundesverband der Energie- und Wasserwirtschaft).
Used for all BDEW-issued market participant codes in the German electricity and gas markets. This is the correct agency code for suppliers (LFN), distribution system operators (NB/VNB), metering point operators (MSB), and balance responsible parties (BKV/BRK) registered in the BDEW Marktteilnehmerverzeichnis.
§NAD wire form
NAD+MS+9900123456789::293'Gs1
"9" — GS1 (formerly EAN International).
Used when a 13-digit GLN is issued directly under GS1’s global prefix
scheme rather than through BDEW. Rare in German MaKo practice — most
operators use AgencyCode::Bdew even for GS1-compatible numbers.
Entso
"305" — ECOD (ENTSO-E Coding Scheme / European network operator).
Used for 16-character EIC (Energy Identification Codes) issued by ENTSO-E. Required for transmission grid operators (ÜNB/TSO), balance zones (Regelzonen), and cross-border market participants.
§NAD wire form
NAD+MS+10XDE-EON-NETZ--I::305'Dvgw
"332" — DVGW (Deutscher Verein des Gas- und Wasserfaches).
Occasionally used for gas-sector participants registered in the DVGW
system before the BDEW merger. Modern gas market messages prefer
AgencyCode::Bdew; this variant is kept for parsing legacy messages.
Implementations§
Source§impl AgencyCode
impl AgencyCode
Sourcepub const DEFAULT: Self = Self::Bdew
pub const DEFAULT: Self = Self::Bdew
Default agency code for new outbound EDI@Energy messages.
293 (BDEW) is the correct default for all standard German market
participants. Change to AgencyCode::Entso only for TSO/ÜNB parties
that carry an EIC code.
Trait Implementations§
Source§impl Clone for AgencyCode
impl Clone for AgencyCode
Source§fn clone(&self) -> AgencyCode
fn clone(&self) -> AgencyCode
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for AgencyCode
Source§impl Debug for AgencyCode
impl Debug for AgencyCode
Source§impl Default for AgencyCode
impl Default for AgencyCode
Source§impl Display for AgencyCode
impl Display for AgencyCode
impl Eq for AgencyCode
Source§impl Hash for AgencyCode
impl Hash for AgencyCode
Source§impl PartialEq for AgencyCode
impl PartialEq for AgencyCode
impl StructuralPartialEq for AgencyCode
Auto Trait Implementations§
impl Freeze for AgencyCode
impl RefUnwindSafe for AgencyCode
impl Send for AgencyCode
impl Sync for AgencyCode
impl Unpin for AgencyCode
impl UnsafeUnpin for AgencyCode
impl UnwindSafe for AgencyCode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T, O> Matches<O> for Twhere
T: PartialEq<O>,
impl<T, O> Matches<O> for Twhere
T: PartialEq<O>,
fn validate_matches(&self, other: &O) -> bool
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString. Read more