#[non_exhaustive]pub enum AppConfigError {
Frozen,
NotFound(String),
PathParse {
cause_message: String,
},
FileParse {
uri: Option<String>,
cause_message: String,
},
Type {
origin: Option<String>,
unexpected_content: String,
expected: &'static str,
key: Option<String>,
},
At {
error_message: String,
origin: Option<String>,
key: Option<String>,
},
Message(String),
Foreign(String),
Unsupported(String),
}Expand description
Re-exports the AppConfig-related types.
A cloneable representation of a configuration error.
This enum exists because the upstream ConfigError from the config crate
is not Clone. Strut caches configuration results, including errors, to
avoid costly reparsing. To support this caching, a cloneable error type
is required.
This enum mirrors the structure of ConfigError and provides From
implementations to convert from it. Most variants and their fields directly
correspond to their upstream counterparts.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Frozen
The equivalent of ConfigError::Frozen.
NotFound(String)
The equivalent of ConfigError::NotFound.
PathParse
The equivalent of ConfigError::PathParse.
Fields
cause_message: StringThe stringified equivalent of the cause field on
ConfigError::PathParse.
FileParse
The equivalent of ConfigError::FileParse.
Fields
uri: Option<String>The equivalent of the uri field on ConfigError::FileParse.
cause_message: StringThe stringified equivalent of the cause field on
ConfigError::FileParse.
Type
The equivalent of ConfigError::Type.
Fields
origin: Option<String>The equivalent of the origin field on ConfigError::Type.
unexpected_content: StringThe stringified equivalent of the unexpected field on
ConfigError::Type.
expected: &'static strThe equivalent of the expected field on ConfigError::Type.
key: Option<String>The equivalent of the key field on ConfigError::Type.
At
The equivalent of ConfigError::At.
Fields
error_message: StringThe stringified equivalent of the error field on
ConfigError::At.
origin: Option<String>The equivalent of the origin field on ConfigError::At.
key: Option<String>The equivalent of the key field on ConfigError::At.
Message(String)
The equivalent of ConfigError::Message.
Foreign(String)
The stringified equivalent of ConfigError::Foreign.
Unsupported(String)
Covers any additional variants of ConfigError that may appear in the
future (since the enum is marked with #[non_exhaustive]).
Trait Implementations§
Source§impl Clone for AppConfigError
impl Clone for AppConfigError
Source§fn clone(&self) -> AppConfigError
fn clone(&self) -> AppConfigError
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AppConfigError
Replicates the Debug implementation of ConfigError verbatim, for the
lack of a better option.
impl Debug for AppConfigError
Replicates the Debug implementation of ConfigError verbatim, for the
lack of a better option.
Source§impl Display for AppConfigError
Replicates the Display implementation of ConfigError verbatim, for
the lack of a better option.
impl Display for AppConfigError
Replicates the Display implementation of ConfigError verbatim, for
the lack of a better option.
Source§impl From<&ConfigError> for AppConfigError
Enables transmuting a reference to ConfigError to an owned
AppConfigError.
impl From<&ConfigError> for AppConfigError
Enables transmuting a reference to ConfigError to an owned
AppConfigError.
Source§fn from(value: &ConfigError) -> Self
fn from(value: &ConfigError) -> Self
Source§impl From<ConfigError> for AppConfigError
Enables consuming a ConfigError to make an owned AppConfigError.
impl From<ConfigError> for AppConfigError
Enables consuming a ConfigError to make an owned AppConfigError.