#[non_exhaustive]pub enum LoadError {
NotFound(PathBuf),
Io {
path: PathBuf,
source: Error,
},
Parse {
path: PathBuf,
source: Box<Error>,
},
Validation {
path: PathBuf,
source: ConfigError,
},
RemovedKey {
path: PathBuf,
key: &'static str,
hint: &'static str,
},
ModuleFactory(String),
}Expand description
Why loading the configuration failed. Each variant maps to a distinct operator diagnosis (file vs syntax vs semantics).
#[non_exhaustive] (since 0.3, when ModuleFactory was added): new failure kinds can be
added without a breaking change — external code matching this enum must carry a _ arm.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
NotFound(PathBuf)
The file does not exist — distinct from a present-but-wrong file.
Io
The file exists but could not be read (permissions, etc.).
Parse
TOML syntax error or a missing/incorrectly-typed required field
(serde reports e.g. “missing field backend”). Boxed: toml::de::Error
is large and would bloat every Result otherwise.
Validation
Syntactically valid but semantically invalid (out-of-range, bad CIDR, …).
RemovedKey
A removed config key is still present — a clear migration error, never a silent no-op. Carries the offending key and the migration hint.
ModuleFactory(String)
The config itself validated, but rebuilding the injected (embedder) modules failed
on reload (core 0.3 ModuleFactory) — e.g. an enterprise schema file became invalid
on disk. The reload is aborted and the last-good modules kept; carries the message.
Trait Implementations§
Source§impl Error for LoadError
impl Error for LoadError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()