pub enum Error {
LoadFileError {
name: String,
source: Option<Box<dyn StdError + Send + Sync>>,
},
ParseError {
name: String,
format: String,
source: Option<Box<dyn StdError + Send + Sync>>,
},
ValueError {
key: String,
expected_type: String,
actual_value: String,
},
InvalidPathError {
path: String,
reason: String,
},
ValidationError {
message: String,
},
IoError {
operation: String,
source: Option<Box<dyn StdError + Send + Sync>>,
},
}
Variants§
LoadFileError
Failed to load or read a configuration file
ParseError
Failed to parse configuration content (JSON, YAML, TOML, etc.)
ValueError
Invalid configuration value or type conversion error
InvalidPathError
Invalid file path or configuration target
ValidationError
Configuration validation failed
IoError
I/O operation failed
Implementations§
Source§impl Error
impl Error
pub fn file_not_found(path: &str) -> Self
pub fn parse_json_error( path: &str, source: impl StdError + Send + Sync + 'static, ) -> Self
pub fn parse_yaml_error( path: &str, source: impl StdError + Send + Sync + 'static, ) -> Self
pub fn parse_toml_error( path: &str, source: impl StdError + Send + Sync + 'static, ) -> Self
pub fn invalid_path(path: &str, reason: &str) -> Self
pub fn value_conversion_error(key: &str, expected: &str, actual: &str) -> Self
Trait Implementations§
Source§impl Error for Error
impl Error for Error
Source§fn source(&self) -> Option<&(dyn StdError + 'static)>
fn source(&self) -> Option<&(dyn StdError + '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 Error
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl !UnwindSafe for Error
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