pub enum ConfigError {
Path(PathsError),
Read {
path: PathBuf,
source: Error,
},
Parse {
path: PathBuf,
source: Error,
},
Write {
path: PathBuf,
source: Error,
},
Serialize(Error),
UnsupportedSchemaVersion {
path: PathBuf,
found: u32,
},
}Expand description
Failure loading or persisting config.toml. The file-scoped variants
carry the offending path so callers can surface an actionable message.
Variants§
Path(PathsError)
The platform config directory could not be resolved (no home directory for the current user).
Read
Reading the config file from disk failed.
Parse
The file was read but is not valid TOML for this schema.
Fields
Write
Writing the updated config back to disk failed.
Serialize(Error)
The in-memory config could not be serialized to TOML — a bug in the
config types rather than user error, since Config always
serializes cleanly.
UnsupportedSchemaVersion
The file declares a schema_version newer than this build
understands; failing loudly avoids silently dropping settings a newer
build wrote.
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§impl From<PathsError> for ConfigError
impl From<PathsError> for ConfigError
Source§fn from(source: PathsError) -> Self
fn from(source: PathsError) -> Self
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