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 read_file(path: impl Into<PathBuf>, source: Error) -> ConfigError
pub fn read_file(path: impl Into<PathBuf>, source: Error) -> ConfigError
Creates a read file error.
Sourcepub fn parse_toml(path: impl Into<PathBuf>, source: Error) -> ConfigError
pub fn parse_toml(path: impl Into<PathBuf>, source: Error) -> ConfigError
Creates a parse TOML error.
Sourcepub fn write_file(path: impl Into<PathBuf>, source: Error) -> ConfigError
pub fn write_file(path: impl Into<PathBuf>, source: Error) -> ConfigError
Creates a write file error.
Sourcepub fn invalid_env_var(
name: impl Into<String>,
message: impl Into<String>,
) -> ConfigError
pub fn invalid_env_var( name: impl Into<String>, message: impl Into<String>, ) -> ConfigError
Creates an invalid env var error.
Sourcepub fn create_dir(path: impl Into<PathBuf>, source: Error) -> ConfigError
pub fn create_dir(path: impl Into<PathBuf>, source: Error) -> ConfigError
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()
Source§impl From<Error> for ConfigError
impl From<Error> for ConfigError
Source§fn from(source: Error) -> ConfigError
fn from(source: 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
Source§impl<E> ExternalError for E
impl<E> ExternalError for E
fn into_lua_err(self) -> Error
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreimpl<T> MaybeSend for Twhere
T: Send,
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.