pub struct VarEnv<N: Eq + Hash, V> { /* private fields */ }Expand description
An environment module for setting, getting, and exporting shell variables.
Implementations§
Source§impl<N, V> VarEnv<N, V>
impl<N, V> VarEnv<N, V>
Sourcepub fn with_process_env_vars() -> Self
pub fn with_process_env_vars() -> Self
Constructs a new environment and initializes it with the environment variables of the current process.
Sourcepub fn with_env_vars<I: IntoIterator<Item = (N, V)>>(iter: I) -> Self
pub fn with_env_vars<I: IntoIterator<Item = (N, V)>>(iter: I) -> Self
Constructs a new environment with a provided collection of (key, value)
environment variable pairs. These variables (if any) will be inherited by
all commands.
Trait Implementations§
Source§impl<N, V> ExportedVariableEnvironment for VarEnv<N, V>
impl<N, V> ExportedVariableEnvironment for VarEnv<N, V>
Source§impl<N, V> SubEnvironment for VarEnv<N, V>
impl<N, V> SubEnvironment for VarEnv<N, V>
Source§impl<N, V> UnsetVariableEnvironment for VarEnv<N, V>
impl<N, V> UnsetVariableEnvironment for VarEnv<N, V>
Source§impl<N, V> VariableEnvironment for VarEnv<N, V>
impl<N, V> VariableEnvironment for VarEnv<N, V>
Source§fn var<Q>(&self, name: &Q) -> Option<&Self::Var>
fn var<Q>(&self, name: &Q) -> Option<&Self::Var>
Get the value of some variable. The values of both shell-only
and environment variables will be looked up and returned.
impl<N: Eq + Eq + Hash, V: Eq> Eq for VarEnv<N, V>
impl<N: Eq + Hash, V> StructuralPartialEq for VarEnv<N, V>
Auto Trait Implementations§
impl<N, V> Freeze for VarEnv<N, V>
impl<N, V> RefUnwindSafe for VarEnv<N, V>where
N: RefUnwindSafe,
V: RefUnwindSafe,
impl<N, V> Send for VarEnv<N, V>
impl<N, V> Sync for VarEnv<N, V>
impl<N, V> Unpin for VarEnv<N, V>
impl<N, V> UnwindSafe for VarEnv<N, V>where
N: RefUnwindSafe,
V: RefUnwindSafe,
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