pub trait InputResolveExt<T> {
// Required methods
fn env_names(&self) -> Vec<&'static str>;
fn get(&self) -> Option<T>;
fn get_in(&self, env: &impl EnvSource) -> Option<T>;
fn get_from(&self, resolution: &Resolution) -> Option<T>;
fn is_set(&self) -> bool;
fn is_set_in(&self, env: &impl EnvSource) -> bool;
fn raw(&self) -> Option<String>;
fn raw_in(&self, env: &impl EnvSource) -> Option<String>;
}Expand description
Runtime-reading methods for Input, added by this crate.
Implemented for every Input<T, C> whose T implements FromRaw —
which is every Input that could ever have a value read out of it.
use argenv_resolve::*; brings this into scope automatically; you will
not usually name it directly, just call .get_from(&resolution) etc.
Required Methods§
Sourcefn get(&self) -> Option<T>
fn get(&self) -> Option<T>
Read and parse from the process environment. None means absent
or invalid — never a silent empty string.
Sourcefn get_in(&self, env: &impl EnvSource) -> Option<T>
fn get_in(&self, env: &impl EnvSource) -> Option<T>
Read and parse from env.
Use this to check an environment being assembled for a child process, to read a snapshot captured elsewhere, or to test without mutating global process state.
Sourcefn get_from(&self, resolution: &Resolution) -> Option<T>
fn get_from(&self, resolution: &Resolution) -> Option<T>
Read and parse from a resolved invocation, honouring precedence across both bindings.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".