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,
},
}Expand description
Why loading the configuration failed. Each variant maps to a distinct operator diagnosis (file vs syntax vs semantics).
Variants§
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.
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)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Auto Trait Implementations§
impl !RefUnwindSafe for LoadError
impl !UnwindSafe for LoadError
impl Freeze for LoadError
impl Send for LoadError
impl Sync for LoadError
impl Unpin for LoadError
impl UnsafeUnpin for LoadError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more