pub enum FromEnvErr<Inner> {
EnvError(String, VarError),
Empty(String),
ParseError(Inner),
}Expand description
Error type for loading from the environment. See the FromEnv trait for
more information.
Variants§
EnvError(String, VarError)
The environment variable is missing.
Empty(String)
The environment variable is empty.
ParseError(Inner)
The environment variable is present, but the value could not be parsed.
Implementations§
Source§impl FromEnvErr<Infallible>
impl FromEnvErr<Infallible>
Sourcepub fn infallible_into<T>(self) -> FromEnvErr<T>
pub fn infallible_into<T>(self) -> FromEnvErr<T>
Convert the error into another error type.
Source§impl<Inner> FromEnvErr<Inner>
impl<Inner> FromEnvErr<Inner>
Sourcepub fn from<Other>(other: FromEnvErr<Other>) -> Selfwhere
Inner: From<Other>,
pub fn from<Other>(other: FromEnvErr<Other>) -> Selfwhere
Inner: From<Other>,
Create a new error from another error type.
Sourcepub fn map<New>(self, f: impl FnOnce(Inner) -> New) -> FromEnvErr<New>
pub fn map<New>(self, f: impl FnOnce(Inner) -> New) -> FromEnvErr<New>
Map the error to another type. This is useful for converting the error type to a different type, while keeping the other error information intact.
Sourcepub const fn parse_error(err: Inner) -> Self
pub const fn parse_error(err: Inner) -> Self
Error while parsing.
Trait Implementations§
Source§impl<Inner: Clone> Clone for FromEnvErr<Inner>
impl<Inner: Clone> Clone for FromEnvErr<Inner>
Source§fn clone(&self) -> FromEnvErr<Inner>
fn clone(&self) -> FromEnvErr<Inner>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<Inner: Debug> Debug for FromEnvErr<Inner>
impl<Inner: Debug> Debug for FromEnvErr<Inner>
Source§impl<Inner> Display for FromEnvErr<Inner>where
Inner: Display,
impl<Inner> Display for FromEnvErr<Inner>where
Inner: Display,
Source§impl<Inner> Error for FromEnvErr<Inner>
impl<Inner> Error for FromEnvErr<Inner>
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<Inner> From<Inner> for FromEnvErr<Inner>
impl<Inner> From<Inner> for FromEnvErr<Inner>
Source§impl<Inner: PartialEq> PartialEq for FromEnvErr<Inner>
impl<Inner: PartialEq> PartialEq for FromEnvErr<Inner>
impl<Inner: Eq> Eq for FromEnvErr<Inner>
impl<Inner> StructuralPartialEq for FromEnvErr<Inner>
Auto Trait Implementations§
impl<Inner> Freeze for FromEnvErr<Inner>where
Inner: Freeze,
impl<Inner> RefUnwindSafe for FromEnvErr<Inner>where
Inner: RefUnwindSafe,
impl<Inner> Send for FromEnvErr<Inner>where
Inner: Send,
impl<Inner> Sync for FromEnvErr<Inner>where
Inner: Sync,
impl<Inner> Unpin for FromEnvErr<Inner>where
Inner: Unpin,
impl<Inner> UnwindSafe for FromEnvErr<Inner>where
Inner: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.