๐ก mediation
The arithmetic between a telecom network โ mobile or fixed โ and a billing system: normalising, validating, deduplicating and correlating usage records, and proving none was lost.
๐ง Zero I/O ยท โฑ๏ธ no async ยท ๐ฐ๏ธ no clock ยท ๐ข exact integer quantities ยท ๐ no
unsafe
It computes usage, not money: octets, seconds and event counts, attributed to a charged party, a network and a service. Pricing belongs to the rating layer.
๐ Documentation ยท ๐ฆ API reference
๐ฆ Install
serde (off by default) adds Serialize/Deserialize in each type's canonical
string form. MSRV is Rust 1.94 (edition 2024). Pre-1.0: breaking changes ship as
minor releases.
๐ One pass over a batch
process deduplicates, reassembles, checks sequence gaps, validates and
disposes every record, and returns a reconciliation that must balance:
carried_in + ingested == billable + suppressed + duplicate + rejected + held
use ;
use ;
# use ;
# use Ipv4Addr;
#
let records: = .map.collect;
let mut state = new;
let outcome = process;
assert!;
assert_eq!;
assert!;
ProcessState (dedup keys, sequence high-water marks, held records) is owned by
the caller and serialisable, so process stays a pure function of
(batch, config, as_of, state) and a replay gives the same verdicts.
๐ Topics
| Page | Failure it prevents |
|---|---|
| Time | Local CDR time read as UTC books events on the wrong day |
| Quantities | Float volumes lose octets; MB means two things |
| Identity | Malformed IMSI/MSISDN/IMEI reaching billing |
| Fixed-line voice | Dial strings that are not E.164 numbers |
| Completeness | A lost file leaves no trace except a sequence hole |
| Deduplication | Retransmissions billed twice |
| Conservation | A record lost between ingest and release |
| Validation | The rule catalogue V01โV21 and the release gate |
| Regulatory | Jurisdiction, EU fair use, retention, itemised bills |
๐ซ Out of scope
Collection and transport (GTPโฒ, SFTP, Kafka, Diameter), rating and pricing, online charging (Ro/Nchf), scheduling and storage, and generated ASN.1 schemas. Decoding bytes already in memory is in scope; fetching them is not.
๐งช Development
Every Rust block in this README and on the documentation site runs as a doctest
(ReadmeDoctests and site_doctests in src/lib.rs). New rules
cite the clause they implement and come with a test.
๐ License
Licensed under either of Apache License, Version 2.0 or MIT license at your option. Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
โน๏ธ Rules derived from published standards and regulations. Not legal advice; verify against the current text for your use case.