pub struct DataBundle {
pub format_version: String,
pub bundle_version: u32,
pub variants: BTreeMap<String, VariantCache>,
pub bo4e_catalog: Bo4eCatalog,
pub built_by: Option<String>,
pub code_lists: CodeLists,
}Expand description
Bundled data for a single format version (e.g., FV2504).
Contains all VariantCaches for every message type in that FV, serialized as one bincode file for distribution via GitHub releases.
Fields§
§format_version: String§bundle_version: u32§variants: BTreeMap<String, VariantCache>§bo4e_catalog: Bo4eCatalogPID-agnostic BO4E type catalog (parsed from bo4e-german source).
Populated by the bundle generator at compile-mappings time. Older bundles without this field deserialize to an empty catalog.
built_by: Option<String>The crate version that produced this bundle.
Distinct from bundle_version, which guards the
serialisation format and has been unchanged for many releases — a
bundle can satisfy it while its mappings, schemas and code lists come
from another era. That is not a hypothetical: a bundle five months old
passed the format check, loaded cleanly, and rendered 12% of a message
with no error (issue #158).
None for bundles produced before this field existed, which is itself
evidence of age.
code_lists: CodeListsThe shared code-list tables the definitions’ code_list names resolve
against.
Carried IN the bundle, unlike VariantCache, which is written beside a
copy of code_lists.toml and repairs itself from it on load. A bundle
is a bare .bin fetched into ~/.edifact/data with nothing beside it,
so a bundle that does not carry its tables cannot resolve a single
name: forward, the EDIFACT code reaches the output untranslated;
reverse, the BO4E name is written into the EDIFACT slot verbatim. The
deduplication that made naming worth doing does not argue against this
– there is one bundle per format version, so the tables appear once.
Implementations§
Source§impl DataBundle
impl DataBundle
pub const CURRENT_VERSION: u32 = 2
Sourcepub const PRODUCING_VERSION: &'static str = "0.8.0"
pub const PRODUCING_VERSION: &'static str = "0.8.0"
The release a bundle built now belongs to, and the one a bundle must have been built by to be read.
Taken from mig-bo4e rather than from whichever crate produces or
consumes a bundle: mig-bo4e carries the workspace version, which is
what the release process stamps, while automapper-generator versions
itself separately. Reading it from the producer gave 0.1.0 against a
consumer expecting 0.1.1 — a mismatch that is an artefact of where the
constant was read, not of the data.