Struct conch_runtime::env::VarEnv [−][src]
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]
impl<N: Eq + Hash, V> VarEnv<N, V>pub fn new() -> Self[src]
pub fn new() -> SelfConstructs a new environment with no environment variables.
pub fn with_process_env_vars() -> Self where
N: From<String>,
V: From<String>, [src]
pub fn with_process_env_vars() -> Self where
N: From<String>,
V: From<String>, Constructs a new environment and initializes it with the environment variables of the current process.
pub fn with_env_vars<I: IntoIterator<Item = (N, V)>>(iter: I) -> Self[src]
pub fn with_env_vars<I: IntoIterator<Item = (N, V)>>(iter: I) -> SelfConstructs 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]
impl<N: PartialEq + Eq + Hash, V: PartialEq> PartialEq for VarEnv<N, V>fn eq(&self, other: &VarEnv<N, V>) -> bool[src]
fn eq(&self, other: &VarEnv<N, V>) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, other: &VarEnv<N, V>) -> bool[src]
fn ne(&self, other: &VarEnv<N, V>) -> boolThis method tests for !=.
impl<N: Eq + Eq + Hash, V: Eq> Eq for VarEnv<N, V>[src]
impl<N: Eq + Eq + Hash, V: Eq> Eq for VarEnv<N, V>impl<N: Eq + Hash + Clone, V: Clone + Eq> VariableEnvironment for VarEnv<N, V>[src]
impl<N: Eq + Hash + Clone, V: Clone + Eq> VariableEnvironment for VarEnv<N, V>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]
fn var<Q: ?Sized>(&self, name: &Q) -> Option<&Self::Var> where
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]
fn set_var(&mut self, name: Self::VarName, val: Self::Var)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]
fn env_vars(&self) -> Cow<[(&Self::VarName, &Self::Var)]>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]
impl<N: Eq + Hash + Clone, V: Clone + Eq> ExportedVariableEnvironment for VarEnv<N, V>fn exported_var(&self, name: &Self::VarName) -> Option<(&Self::Var, bool)>[src]
fn exported_var(&self, name: &Self::VarName) -> Option<(&Self::Var, bool)>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]
fn set_exported_var(
&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]
impl<N: Eq + Hash + Clone, V: Eq + Clone> UnsetVariableEnvironment for VarEnv<N, V>fn unset_var<Q: ?Sized>(&mut self, name: &Q) where
Self::VarName: Borrow<Q>,
Q: Hash + Eq, [src]
fn unset_var<Q: ?Sized>(&mut self, name: &Q) where
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 + Ord + Hash + Debug, V: Debug> Debug for VarEnv<N, V>fn fmt(&self, fmt: &mut Formatter) -> Result[src]
fn fmt(&self, fmt: &mut Formatter) -> ResultFormats the value using the given formatter. Read more
impl<N: Eq + Hash, V> Default for VarEnv<N, V>[src]
impl<N: Eq + Hash, V> Default for VarEnv<N, V>impl<N: Eq + Hash, V> Clone for VarEnv<N, V>[src]
impl<N: Eq + Hash, V> Clone for VarEnv<N, V>fn clone(&self) -> Self[src]
fn clone(&self) -> SelfReturns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)Performs copy-assignment from source. Read more
impl<N: Eq + Hash, V> SubEnvironment for VarEnv<N, V>[src]
impl<N: Eq + Hash, V> SubEnvironment for VarEnv<N, V>