pub struct Vars<S: CmdString = OsString>(/* private fields */);
Expand description
A set of environment variables.
Implementations§
source§impl<S: CmdString> Vars<S>
impl<S: CmdString> Vars<S>
sourcepub fn is_clean(&self) -> bool
pub fn is_clean(&self) -> bool
Indicates that all other environment variables shall be discarded.
sourcepub fn values(&self) -> impl Iterator<Item = (&S::Str, Option<&S::Str>)>
pub fn values(&self) -> impl Iterator<Item = (&S::Str, Option<&S::Str>)>
The values of the environment variables.
sourcepub fn set<N: AsRef<S::Str>, V: AsRef<S::Str>>(
&mut self,
name: N,
value: V
) -> &mut Self
pub fn set<N: AsRef<S::Str>, V: AsRef<S::Str>>( &mut self, name: N, value: V ) -> &mut Self
Sets the value of an environment variable.
sourcepub fn unset<N: AsRef<S::Str>>(&mut self, name: N) -> &mut Self
pub fn unset<N: AsRef<S::Str>>(&mut self, name: N) -> &mut Self
Discards the value of an environment variable.
Trait Implementations§
source§impl<'de, S> Deserialize<'de> for Vars<S>where
S: Deserialize<'de> + CmdString,
impl<'de, S> Deserialize<'de> for Vars<S>where
S: Deserialize<'de> + CmdString,
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl<S> RefUnwindSafe for Vars<S>where
S: RefUnwindSafe,
impl<S> Send for Vars<S>
impl<S> Sync for Vars<S>
impl<S> Unpin for Vars<S>
impl<S> UnwindSafe for Vars<S>where
S: 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