pub enum ConfigError {
FileNotFound {
path: String,
},
ParseFailed {
context: String,
},
InvalidValue {
field: String,
value: String,
},
MissingField {
field: String,
},
Io {
context: String,
source: Error,
},
NoHomeDirectory,
}Expand description
Errors that can occur during configuration loading.
Variants§
FileNotFound
The configuration file was not found.
ParseFailed
Failed to parse the configuration file.
InvalidValue
A configuration value is invalid.
MissingField
A required configuration field is missing.
Io
File system I/O error.
Fields
NoHomeDirectory
Home directory could not be determined.
Implementations§
Source§impl ConfigError
impl ConfigError
Sourcepub fn file_not_found(path: impl Into<String>) -> Self
pub fn file_not_found(path: impl Into<String>) -> Self
Create a FileNotFound error.
Sourcepub fn parse_failed(context: impl Into<String>) -> Self
pub fn parse_failed(context: impl Into<String>) -> Self
Create a ParseFailed error.
Sourcepub fn invalid_value(field: impl Into<String>, value: impl Into<String>) -> Self
pub fn invalid_value(field: impl Into<String>, value: impl Into<String>) -> Self
Create an InvalidValue error.
Sourcepub fn missing_field(field: impl Into<String>) -> Self
pub fn missing_field(field: impl Into<String>) -> Self
Create a MissingField error.
Sourcepub const fn no_home_directory() -> Self
pub const fn no_home_directory() -> Self
Create a NoHomeDirectory 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<ConfigError> for TxGateError
impl From<ConfigError> for TxGateError
Source§fn from(source: ConfigError) -> Self
fn from(source: ConfigError) -> Self
Converts to this type from the input type.
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