Expand description
§carrier-core — what the German carrier interfaces share
WBCI (provider ↔ provider) and S/PRI (network owner ↔ service provider) are separate interfaces of the AK S&P, but they carry the same identifiers, count the same working days, wrap their payloads in the same kind of envelope and must read the same hostile XML safely. This crate holds that common ground, so a fix in one interface is a fix in both:
| Module | What |
|---|---|
text | schema facets, ValueError, the text_type! and code_enum! macros |
id | CarrierCode, VorabstimmungsId, LineId |
calendar | working days: weekends, nationwide public holidays, closed days |
count | working-day and working-hour arithmetic with an count::Explanation |
envelope | Zeitstempel, SignaturId, SignaturText |
xml | the bounded tree parser, the schema-order cursor and the writer |
sim | sim::Latency of the simulated peers |
Its API serves the sibling crates wbci and spri, which re-export what their users need;
it is not stable on its own.
use carrier_core::{CarrierCode, VorabstimmungsId};
let carrier: CarrierCode = "DEU.EKP1".parse()?;
let id = VorabstimmungsId::allocate(&carrier, 13)?;
assert_eq!(id.as_str(), "DEU.EKP1.V000000013");Unofficial; not affiliated with or endorsed by the AK S&P, VATM or BUGLAS.
Re-exports§
pub use calendar::Calendar;pub use envelope::SignaturId;pub use envelope::SignaturText;pub use envelope::Zeitstempel;pub use id::CarrierCode;pub use id::LineId;pub use id::MAX_SEQUENCE;pub use id::VorabstimmungsId;pub use text::ValueError;pub use text::ValueErrorKind;
Modules§
- calendar
- Working days (Arbeitstage, AT).
- count
- Counting working days and working hours, with the arithmetic kept for the reader.
- envelope
- Envelope values every payload carries: the send timestamp and the signing certificate.
- id
- Identifiers both WBCI and S/PRI carry: carrier codes, the Vorabstimmungs-ID and the LineID.
- sim
- What the simulated peers of both interfaces share: how long they take to answer.
- text
- Lexical facets of the carrier schemas: the permitted character set, whitespace handling and lengths, and the macros that turn them into newtypes and code enumerations.
- xml
- The hardened XML foundation: a bounded tree parser, a cursor that walks an element’s children in schema order, and an indenting writer.
Macros§
- code_
enum - Declares a
Copyenum of schema codes withas_str,from_codeandDisplay. - request_
id - Declares a WBCI request id
CC.ICC.<letter>[0-9A-Z]{9}withallocateandcarrier. - text_
type - Declares a newtype over
Stringwith aTextSpec.