pub trait VariableEnvironment {
type VarName: Eq + Hash;
type Var;
// Required methods
fn var<Q>(&self, name: &Q) -> Option<&Self::Var>
where Self::VarName: Borrow<Q>,
Q: Hash + Eq + ?Sized;
fn set_var(&mut self, name: Self::VarName, val: Self::Var);
fn env_vars(&self) -> Cow<'_, [(&Self::VarName, &Self::Var)]>;
}Expand description
An interface for setting and getting shell and environment variables.
Required Associated Types§
Required Methods§
Sourcefn 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.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.