pub enum ConfigError {
InvalidFileEncoding(Error, PathBuf),
IoError(Error),
DataParseError(DataParseError),
UnknownFormat(UnknownFormatError),
}Expand description
The main result error type of the crate.
Each type has it’s own documentation.
Variants§
InvalidFileEncoding(Error, PathBuf)
Occurs when a file isn’t composed of valid UTF-8 characters.
- Stores the path to the erroring file
IoError(Error)
Occurs when the file could not be saved due to filesystem-related errors.
Usually when one of the parent directories for the config file could not
be located or automatically created.
- Stores the
std::io::Errorin question
DataParseError(DataParseError)
Occurs when Serde fails to serialize/deserialize your data
- Stores an enum containing the section of data parsing failed for
(serialization/deserialization)
UnknownFormat(UnknownFormatError)
Occurs when fast_config cannot guess what format your data should be.
- Stores some data related to the error
§This error can be avoided by either:
- Adding a file extension at the end of the path name
(
json/json5,toml,yaml/yml)
(It would be appreciated if you create an issue on the project’s Github if you notice an extension type is missing) - Passing a
ConfigSetupOptionsstruct intoConfig::from_options, and defining the format there. - Or only having one enabled
formatfeature in yourcargo.toml
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<DataParseError> for ConfigError
impl From<DataParseError> for ConfigError
Source§fn from(item: DataParseError) -> Self
fn from(item: DataParseError) -> 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