#[non_exhaustive]pub enum LayeredError {
Cli(Error),
Io {
path: PathBuf,
source: Error,
},
Parse {
path: PathBuf,
line: usize,
column: usize,
message: String,
},
Invalid {
field: String,
value: String,
layer: SourceLayer,
message: String,
},
}Expand description
Errors produced while loading layered configuration.
Every variant names the layer it came from, so a bad value is never reported as an anonymous post-merge failure.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Cli(Error)
Command-line parsing failed, or clap was asked to display help/version.
Layered::layered never returns this — it defers to
clap::Error::exit, matching clap::Parser::parse. It is only
returned by Layered::layered_from.
Io
The configuration file exists but could not be read.
A missing config file is not an error; the layer is simply skipped.
Fields
Parse
The configuration file is not valid TOML.
Fields
Invalid
A layer supplied a value that could not be decoded into the field’s type.
Trait Implementations§
Source§impl Debug for LayeredError
impl Debug for LayeredError
Source§impl Display for LayeredError
impl Display for LayeredError
Source§impl Error for LayeredError
impl Error for LayeredError
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 LayeredError
impl !UnwindSafe for LayeredError
impl Freeze for LayeredError
impl Send for LayeredError
impl Sync for LayeredError
impl Unpin for LayeredError
impl UnsafeUnpin for LayeredError
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