pub struct Env { /* private fields */ }Expand description
Environment variables, looked up by name.
Implementations§
Source§impl Env
impl Env
Sourcepub fn case(&self) -> NameCase
pub fn case(&self) -> NameCase
How this environment’s names are compared, which is how the system it came from compares file names too.
Sourcepub fn from_process() -> Env
pub fn from_process() -> Env
The environment of the running process. Only the binary calls this.
Sourcepub fn from_pairs(
pairs: impl IntoIterator<Item = (OsString, OsString)>,
case: NameCase,
) -> Env
pub fn from_pairs( pairs: impl IntoIterator<Item = (OsString, OsString)>, case: NameCase, ) -> Env
An environment holding exactly pairs, with names compared as case
says; a later pair replaces an earlier one with the same name.
Sourcepub fn set_value(&self, name: &str) -> Option<&OsStr>
pub fn set_value(&self, name: &str) -> Option<&OsStr>
The value of cuno’s own variable name (CUNO_HOME and the like),
or None when it is unset or empty: an empty one counts as unset
(docs/en/specs/manifest.md, “Two levels of settings”). Not for
NO_COLOR, which is set even when empty.
Sourcepub fn vars(&self) -> impl Iterator<Item = (&OsStr, &OsStr)>
pub fn vars(&self) -> impl Iterator<Item = (&OsStr, &OsStr)>
Every variable, as (name as spelled, value), for giving a child process exactly this environment.
Trait Implementations§
Auto Trait Implementations§
impl Forget for Env
impl Freeze for Env
impl Move for Env
impl RefUnwindSafe for Env
impl Send for Env
impl Sync for Env
impl Unpin for Env
impl UnsafeUnpin for Env
impl UnwindSafe for Env
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