pub enum Error {
FileNotFound(PathBuf),
Io {
path: PathBuf,
source: Error,
},
Parse {
path: String,
source: Error,
},
Serialize(Error),
Validation {
context: String,
reason: String,
},
Invalid(ValidationErrors),
}Expand description
Everything that can go wrong while loading, merging, or validating a TOML config.
Variants§
FileNotFound(PathBuf)
No file matching the requested name was found by walking parent directories.
Io
OS-level I/O error (permissions, missing dir, etc.).
Parse
The TOML text could not be parsed.
Fields
Serialize(Error)
A config value could not be serialized back to TOML.
Validation
A loaded config failed its own invariant checks (see crate::Validate).
Used for ad-hoc, single-message validation. For structured, path-precise,
multi-error reports, see Error::Invalid.
Fields
Invalid(ValidationErrors)
A loaded config failed structured validation — carries the full
path-precise report of every failure (see crate::ValidationErrors).
Implementations§
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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()
Source§impl From<ValidationErrors> for Error
impl From<ValidationErrors> for Error
Source§fn from(source: ValidationErrors) -> Self
fn from(source: ValidationErrors) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !RefUnwindSafe for Error
impl !UnwindSafe for Error
impl Freeze for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
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