pub enum EnvKind {
OwnedFlag,
ForeignFlag,
OptOutFlag,
ExactValue(&'static str),
Path,
Text,
Number {
zero_selects_default: bool,
},
}Expand description
What kind of value a variable carries, and how it is read.
Variants§
OwnedFlag
A switch the reader defines. Unknown values are off; see flag_owned.
ForeignFlag
A switch whose value space belongs to someone else. Unknown values are
on; see flag_foreign.
OptOutFlag
An escape hatch that is on unless explicitly turned off. Unset is on;
see flag_opt_out.
ExactValue(&'static str)
A switch that is on for exactly one spelling and off for every other, including plausible ones. Reserved for guards where honouring a misspelling would be the dangerous direction.
Path
A filesystem path.
Text
Free text – a name, scope, endpoint, or token.
Number
A number: a count, a timeout in milliseconds, a port, a descriptor.
zero_selects_default records what 0 means for this variable,
because it is not the same answer everywhere. A connect timeout of zero
makes every connection fail instantly and is never what anyone wants,
so zero falls back to the default. A drain timeout of zero means “do
not wait”, which is a perfectly reasonable thing to ask for, so zero is
honoured. Leaving this unstated is how the two ended up parsed
differently by accident.
Trait Implementations§
impl Copy for EnvKind
impl Eq for EnvKind
impl StructuralPartialEq for EnvKind
Auto Trait Implementations§
impl Freeze for EnvKind
impl RefUnwindSafe for EnvKind
impl Send for EnvKind
impl Sync for EnvKind
impl Unpin for EnvKind
impl UnsafeUnpin for EnvKind
impl UnwindSafe for EnvKind
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more