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 this crate 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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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
key and return true if they are equal.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