pub enum ConfigError {
ReadFile {
path: PathBuf,
source: Error,
},
ParseToml {
path: PathBuf,
source: Error,
},
Serialize(Error),
WriteFile {
path: PathBuf,
source: Error,
},
CreateDir {
path: PathBuf,
source: Error,
},
NoHomeDir,
InvalidValue {
key: String,
message: String,
},
WorkspaceNotFound {
name: String,
},
ValidationError(String),
}Expand description
Errors that can occur during configuration loading.
Variants§
ReadFile
Failed to read configuration file
ParseToml
Failed to parse TOML configuration
Serialize(Error)
Failed to serialize configuration
WriteFile
Failed to write configuration file
CreateDir
Failed to create configuration directory
NoHomeDir
Home directory not found
InvalidValue
Invalid configuration value
WorkspaceNotFound
Workspace not found
ValidationError(String)
Configuration validation error
Implementations§
Source§impl ConfigError
impl ConfigError
Sourcepub fn parse_toml(path: impl Into<PathBuf>, source: Error) -> Self
pub fn parse_toml(path: impl Into<PathBuf>, source: Error) -> Self
Create a new ParseToml error.
Sourcepub fn write_file(path: impl Into<PathBuf>, source: Error) -> Self
pub fn write_file(path: impl Into<PathBuf>, source: Error) -> Self
Create a new WriteFile error.
Sourcepub fn create_dir(path: impl Into<PathBuf>, source: Error) -> Self
pub fn create_dir(path: impl Into<PathBuf>, source: Error) -> Self
Create a new CreateDir error.
Sourcepub fn invalid_value(key: impl Into<String>, message: impl Into<String>) -> Self
pub fn invalid_value(key: impl Into<String>, message: impl Into<String>) -> Self
Create a new InvalidValue error.
Sourcepub fn workspace_not_found(name: impl Into<String>) -> Self
pub fn workspace_not_found(name: impl Into<String>) -> Self
Create a new WorkspaceNotFound error.
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()
Auto Trait Implementations§
impl Freeze for ConfigError
impl !RefUnwindSafe for ConfigError
impl Send for ConfigError
impl Sync for ConfigError
impl Unpin for ConfigError
impl !UnwindSafe 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