Expand description
Semantic domain type wrappers for identifiers used across all MaKo process families.
All types in this module wrap Box<str> rather than String — they are
immutable identifiers that are never mutated after construction.
Box<str> is one pointer word smaller than String on the stack and avoids
the extra capacity bookkeeping.
§Why newtypes instead of String?
Domain commands and events have many identifier fields:
ReceiveUtilmd {
sender: String, // GLN
receiver: String, // GLN
location_id: String, // MaLo / EIC
document_date: String, // YYYYMMDD
message_ref: String, // EDIFACT reference
}Passing location_id where sender is expected is a compile-time no-op
when all fields are String. Typed wrappers turn that into a type error.
§Construction
All types implement From<String> and From<&str> for ergonomic
construction without .into() gymnastics:
use mako_engine::types::{MaLo, MarktpartnerCode};
let malo: MaLo = MaLo::new("DE00123456789012345678901234567890");
let sender: MarktpartnerCode = MarktpartnerCode::new("9900123456789");§Serde
All types serialize/deserialize as plain JSON strings, keeping event payloads human-readable in SlateDB and log output.
Structs§
- BikoId
- Bilanzkoordinator-ID (BIKO).
- Billing
Period - Abrechnungszeitraum (billing period).
- BkvId
- Bilanzkreisverantwortlicher-ID (BKV).
- Device
Id - Geräte-ID / Zählernummer.
- MaLo
- Marktlokations-ID (MaLo).
- Marktpartner
Code - Market-participant identifier (Marktpartner-Code).
- MeLo
- Messlokations-ID (MeLo).
- Message
Ref - EDIFACT message reference.
- Pruefidentifikator
- A validated BDEW process-type code (Prüfidentifikator, PID).
- UenbId
- Übertragungsnetzbetreiber-ID (ÜNB).