pub enum ServiceConfError {
Missing {
name: String,
},
FileRead {
name: String,
path: String,
source: Error,
},
Parse {
name: String,
type_name: String,
message: String,
},
}Expand description
Errors that can occur when loading configuration from environment variables.
This error type covers three main failure scenarios:
- Missing required environment variables
- File read failures when using the
{VAR}_FILEpattern - Type parsing failures during deserialization
Variants§
Missing
Required environment variable is not set.
Occurs when a non-optional field’s environment variable is not found and no default value is specified.
FileRead
Failed to read from a file specified by {VAR}_FILE environment variable.
When using #[conf(from_file)], this error occurs if the file path
specified in {VAR}_FILE cannot be read (e.g., file doesn’t exist,
permission denied).
Fields
Parse
Failed to parse environment variable value into the target type.
Occurs when the string value cannot be converted to the field’s type,
either via FromStr or a custom deserializer function.
Trait Implementations§
Source§impl Debug for ServiceConfError
impl Debug for ServiceConfError
Source§impl Display for ServiceConfError
impl Display for ServiceConfError
Source§impl Error for ServiceConfError
impl Error for ServiceConfError
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()
Auto Trait Implementations§
impl Freeze for ServiceConfError
impl !RefUnwindSafe for ServiceConfError
impl Send for ServiceConfError
impl Sync for ServiceConfError
impl Unpin for ServiceConfError
impl !UnwindSafe for ServiceConfError
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