#[non_exhaustive]pub enum ConfigError {
MissingField {
field: &'static str,
},
ParseError {
field: &'static str,
source: String,
message: String,
},
Io(Error),
Format {
path: PathBuf,
message: String,
},
}Expand description
Error returned by ConfigLoad::load.
§Stability
This enum is #[non_exhaustive]: new error variants may be added in minor
releases. Match on it with a trailing wildcard arm (_ => ...) in
downstream code so that adding a variant is not a breaking change.
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.
MissingField
A required field has no value from any source.
ParseError
A value was present but could not be parsed to the field’s type.
Io(Error)
I/O error reading a config file.
Format
TOML parse error in a config file.
Trait Implementations§
Source§impl Debug for ConfigError
impl Debug for ConfigError
Source§impl Display for ConfigError
impl Display for ConfigError
Source§impl Error for ConfigError
impl Error for ConfigError
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<Error> for ConfigError
impl From<Error> for ConfigError
Source§fn from(e: Error) -> ConfigError
fn from(e: Error) -> ConfigError
Converts to this type from the input type.
Auto Trait Implementations§
impl !RefUnwindSafe for ConfigError
impl !UnwindSafe for ConfigError
impl Freeze for ConfigError
impl Send for ConfigError
impl Sync for ConfigError
impl Unpin for ConfigError
impl UnsafeUnpin for ConfigError
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