pub enum ConfigError {
Path(PathsError),
Read {
path: PathBuf,
source: Error,
},
Parse {
path: PathBuf,
source: Box<Error>,
},
ObsoleteField {
path: PathBuf,
field: String,
version: u32,
},
Conflict {
path: PathBuf,
},
Write {
path: PathBuf,
source: Error,
},
Serialize(Error),
Edit {
path: PathBuf,
source: Box<TomlError>,
},
UnsupportedSchemaVersion {
path: PathBuf,
found: u32,
},
}Expand description
Failure loading or persisting config.toml.
Variants§
Path(PathsError)
The platform config directory could not be resolved.
Read
Reading the config file from disk failed.
Parse
The file is not valid TOML for its declared schema.
Fields
ObsoleteField
A field from an older schema was used with a version where it is invalid.
Fields
Conflict
The file changed after it was loaded, so overwriting it would lose edits.
Write
Writing the updated config back to disk failed.
Serialize(Error)
The in-memory config could not be serialized to TOML.
Edit
A generated or previously parsed TOML document could not be edited.
Fields
UnsupportedSchemaVersion
The file declares a schema outside the supported version range.
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