Trait conch_runtime::env::VariableEnvironment
[−]
[src]
pub trait VariableEnvironment { type VarName: Eq + Hash; type Var; fn var<Q: ?Sized>(&self, name: &Q) -> Option<&Self::Var>
where
Self::VarName: Borrow<Q>,
Q: Hash + Eq; fn set_var(&mut self, name: Self::VarName, val: Self::Var); fn env_vars(&self) -> Cow<[(&Self::VarName, &Self::Var)]>; }
An interface for setting and getting shell and environment variables.
Associated Types
type VarName: Eq + Hash
The type of the name this environment associates for a variable.
type Var
The type of variables this environment holds.
Required Methods
fn var<Q: ?Sized>(&self, name: &Q) -> Option<&Self::Var> where
Self::VarName: Borrow<Q>,
Q: Hash + Eq,
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.
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.
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.
Implementations on Foreign Types
impl<'a, T: ?Sized + VariableEnvironment> VariableEnvironment for &'a mut T
[src]
Implementors
impl<A, IO, FD, L, V, EX, WD, N, ERR> VariableEnvironment for Env<A, IO, FD, L, V, EX, WD, N, ERR> where
V: VariableEnvironment,
N: Hash + Eq, type VarName = V::VarName; type Var = V::Var;impl<A, IO, FD, L, V, EX, WD, N, ERR> VariableEnvironment for AtomicEnv<A, IO, FD, L, V, EX, WD, N, ERR> where
V: VariableEnvironment,
N: Hash + Eq, type VarName = V::VarName; type Var = V::Var;impl<N: Eq + Hash + Clone, V: Clone + Eq> VariableEnvironment for VarEnv<N, V> type VarName = N; type Var = V;
impl<N: Eq + Hash + Clone, V: Clone + Eq> VariableEnvironment for AtomicVarEnv<N, V> type VarName = N; type Var = V;