pub enum EnvParseOutcome<T> {
Absent,
Invalid,
Parsed(T),
}Expand description
Outcome of reading and parsing an environment variable.
Unlike the get_env_opt_* helpers, this distinguishes an absent variable
from one that is present but fails to parse, so callers can treat a
malformed value as a hard configuration error instead of silently falling
back to a default.
Variants§
Absent
The variable (and any alias) is not set.
Invalid
The variable is set but its value failed to parse into T.
Parsed(T)
The variable is set and parsed successfully.
Trait Implementations§
Source§impl<T: Clone> Clone for EnvParseOutcome<T>
impl<T: Clone> Clone for EnvParseOutcome<T>
Source§impl<T: Debug> Debug for EnvParseOutcome<T>
impl<T: Debug> Debug for EnvParseOutcome<T>
impl<T: Eq> Eq for EnvParseOutcome<T>
Source§impl<T: PartialEq> PartialEq for EnvParseOutcome<T>
impl<T: PartialEq> PartialEq for EnvParseOutcome<T>
impl<T: PartialEq> StructuralPartialEq for EnvParseOutcome<T>
Auto Trait Implementations§
impl<T> Freeze for EnvParseOutcome<T>where
T: Freeze,
impl<T> RefUnwindSafe for EnvParseOutcome<T>where
T: RefUnwindSafe,
impl<T> Send for EnvParseOutcome<T>where
T: Send,
impl<T> Sync for EnvParseOutcome<T>where
T: Sync,
impl<T> Unpin for EnvParseOutcome<T>where
T: Unpin,
impl<T> UnsafeUnpin for EnvParseOutcome<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for EnvParseOutcome<T>where
T: 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