pub struct DataDir { /* private fields */ }Expand description
Configures where the Mapper looks for DataBundle files.
Bundle files follow the naming convention edifact-data-{FV}.bin
(e.g., edifact-data-FV2504.bin).
§Resolution order for DataDir::auto
$EDIFACT_DATA_DIRenvironment variable (if set)$HOME/.edifact/data(Unix) or%USERPROFILE%\.edifact\data(Windows)./data(current working directory fallback)
Implementations§
Source§impl DataDir
impl DataDir
Sourcepub fn auto() -> Self
pub fn auto() -> Self
Auto-detect the data directory from the environment.
See struct-level docs for resolution order.
Sourcepub fn eager(self, fvs: &[&str]) -> Self
pub fn eager(self, fvs: &[&str]) -> Self
Mark format versions to be eagerly loaded when the Mapper
is created (rather than lazy-loaded on first access).
Sourcepub fn allow_bundle_from_other_release(self, allow: bool) -> Self
pub fn allow_bundle_from_other_release(self, allow: bool) -> Self
Load a bundle even when it was produced by a different release.
Off by default. A crate and a bundle from different releases is the pairing that goes wrong: the format check passes, the bundle loads, and the mappings inside are from another era — which shows up as a smaller message rather than an error (issue #158).
Turn it on only when the mismatch is deliberate and you have some other way of knowing the two belong together.
Sourcepub fn allows_bundle_from_other_release(&self) -> bool
pub fn allows_bundle_from_other_release(&self) -> bool
Whether a bundle from another release may be loaded.
Sourcepub fn bundle_path(&self, fv: &str) -> PathBuf
pub fn bundle_path(&self, fv: &str) -> PathBuf
Path to the bundle file for a specific format version.