pub enum ConfigError {
IoError(Error),
TomlSerError(Error),
TomlDeError(Error),
MissingConfig(PathBuf),
InvalidValue(String),
MissingSection(String),
SchemaError(String),
DirectoryNotFound(PathBuf),
}Expand description
Errors that can occur during configuration operations
Variants§
IoError(Error)
Encapsulates an underlying I/O error from the standard library.
This typically occurs when reading from or writing to configuration files.
TomlSerError(Error)
Represents errors that occur when serializing data to TOML format.
This typically happens when configuration data contains types that cannot be serialized to TOML.
TomlDeError(Error)
Represents errors that occur when deserializing data from TOML format.
This can happen when the TOML configuration content doesn’t match the expected structure.
MissingConfig(PathBuf)
Indicates that a required configuration file was not found.
The associated PathBuf indicates which file was missing.
InvalidValue(String)
Indicates that a configuration value is invalid or out of acceptable range.
This could include type mismatches, values out of range, or invalid formats.
MissingSection(String)
Indicates that a required section in a configuration file is missing.
Configuration files are often organized into sections, and this error indicates that a required section was not found.
SchemaError(String)
Indicates that the configuration doesn’t match the expected schema.
This could include missing fields, incorrect data types, or constraint violations.
DirectoryNotFound(PathBuf)
Indicates that a configuration directory was not found.
This typically occurs when trying to load multiple configuration files from a directory that doesn’t exist.
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)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()