pub enum ConfigError {
ReadFile {
path: PathBuf,
source: Error,
},
ParseToml {
path: PathBuf,
source: Error,
},
Serialize(Error),
WriteFile {
path: PathBuf,
source: Error,
},
InvalidEnvVar {
name: String,
message: String,
},
CreateDir {
path: PathBuf,
source: Error,
},
ProfileNotFound {
name: String,
searched: Vec<PathBuf>,
},
}Expand description
Configuration error type.
Variants§
ReadFile
Failed to read config file.
ParseToml
Failed to parse TOML.
Serialize(Error)
Failed to serialize config.
WriteFile
Failed to write config file.
InvalidEnvVar
Invalid environment variable value.
CreateDir
Failed to create config directory.
ProfileNotFound
Profile not found.
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
Creates a parse TOML error.
Sourcepub fn write_file(path: impl Into<PathBuf>, source: Error) -> Self
pub fn write_file(path: impl Into<PathBuf>, source: Error) -> Self
Creates a write file error.
Sourcepub fn invalid_env_var(
name: impl Into<String>,
message: impl Into<String>,
) -> Self
pub fn invalid_env_var( name: impl Into<String>, message: impl Into<String>, ) -> Self
Creates an invalid env var error.
Sourcepub fn create_dir(path: impl Into<PathBuf>, source: Error) -> Self
pub fn create_dir(path: impl Into<PathBuf>, source: Error) -> Self
Creates a create dir 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 UnsafeUnpin 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