Struct conch_runtime::env::VarEnv
[−]
[src]
pub struct VarEnv<N: Eq + Hash, V> { /* fields omitted */ }
An environment module for setting and getting shell variables.
Uses Rc
internally. For a possible Send
and Sync
implementation,
see env::atomic::VarEnv
.
Methods
impl<N: Eq + Hash, V> VarEnv<N, V>
[src]
fn new() -> Self
[src]
Constructs a new environment with no environment variables.
fn with_process_env_vars() -> Self where
N: From<String>,
V: From<String>,
[src]
N: From<String>,
V: From<String>,
Constructs a new environment and initializes it with the environment variables of the current process.
fn with_env_vars<I: IntoIterator<Item = (N, V)>>(iter: I) -> Self
[src]
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
impl<N: PartialEq + Eq + Hash, V: PartialEq> PartialEq for VarEnv<N, V>
[src]
fn eq(&self, __arg_0: &VarEnv<N, V>) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &VarEnv<N, V>) -> bool
[src]
This method tests for !=
.
impl<N: Eq + Eq + Hash, V: Eq> Eq for VarEnv<N, V>
[src]
impl<N: Eq + Hash + Clone, V: Clone + Eq> VariableEnvironment for VarEnv<N, V>
[src]
type VarName = N
The type of the name this environment associates for a variable.
type Var = V
The type of variables this environment holds.
fn var<Q: ?Sized>(&self, name: &Q) -> Option<&Self::Var> where
Self::VarName: Borrow<Q>,
Q: Hash + Eq,
[src]
Self::VarName: Borrow<Q>,
Q: Hash + Eq,
Get the value of some variable. The values of both shell-only and environment variables will be looked up and returned. Read more
fn set_var(&mut self, name: Self::VarName, val: Self::Var)
[src]
Set the value of some variable, maintaining its status as an environment variable if previously set as such. Read more
fn env_vars(&self) -> Cow<[(&Self::VarName, &Self::Var)]>
[src]
Unset the value of some variable (including environment variables). Get all current pairs of environment variables and their values. Read more
impl<N: Eq + Hash + Clone, V: Clone + Eq> ExportedVariableEnvironment for VarEnv<N, V>
[src]
fn exported_var(&self, name: &Self::VarName) -> Option<(&Self::Var, bool)>
[src]
Get the value of some variable and whether it is exported.
fn set_exported_var(
&mut self,
name: Self::VarName,
val: Self::Var,
exported: bool
)
[src]
&mut self,
name: Self::VarName,
val: Self::Var,
exported: bool
)
Set the value of some variable, and set it's exported status as specified.
impl<N: Eq + Hash + Clone, V: Eq + Clone> UnsetVariableEnvironment for VarEnv<N, V>
[src]
fn unset_var<Q: ?Sized>(&mut self, name: &Q) where
Self::VarName: Borrow<Q>,
Q: Hash + Eq,
[src]
Self::VarName: Borrow<Q>,
Q: Hash + Eq,
Unset the value of some variable (including environment variables).
impl<N: Eq + Ord + Hash + Debug, V: Debug> Debug for VarEnv<N, V>
[src]
impl<N: Eq + Hash, V> Default for VarEnv<N, V>
[src]
impl<N: Eq + Hash, V> Clone for VarEnv<N, V>
[src]
fn clone(&self) -> Self
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more