Struct assert_cli::Environment [−][src]
pub struct Environment { /* fields omitted */ }Structure to deal with environment variables
Methods
impl Environment[src]
impl Environmentpub fn inherit() -> Environment[src]
pub fn inherit() -> EnvironmentCreate a new Environment that inherits this process' environment.
Examples
extern crate environment; use std::ffi::OsString; let e = environment::Environment::inherit().compile(); let e_: Vec<(OsString, OsString)> = ::std::env::vars_os().collect(); assert_eq!(e, e_);
pub fn empty() -> Environment[src]
pub fn empty() -> EnvironmentCreate a new Environment independent of the current process's Environment
Examples
extern crate environment; let e = environment::Environment::empty().compile(); assert_eq!(e, Vec::new());
pub fn insert<S1, S2>(self, key: S1, val: S2) -> Environment where
S1: Into<OsString>,
S2: Into<OsString>, [src]
pub fn insert<S1, S2>(self, key: S1, val: S2) -> Environment where
S1: Into<OsString>,
S2: Into<OsString>, Insert a new entry into the custom variables for this environment object
Examples
extern crate environment; use std::ffi::OsString; let e = environment::Environment::empty().insert("foo", "bar").compile(); assert_eq!(e, vec![(OsString::from("foo"), OsString::from("bar"))]);
pub fn compile(self) -> Vec<(OsString, OsString)>[src]
pub fn compile(self) -> Vec<(OsString, OsString)>Compile Environment object
Trait Implementations
impl Clone for Environment[src]
impl Clone for Environmentfn clone(&self) -> Environment[src]
fn clone(&self) -> EnvironmentReturns 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)1.0.0
[src]Performs copy-assignment from source. Read more
impl Default for Environment[src]
impl Default for Environmentfn default() -> Environment[src]
fn default() -> EnvironmentReturns the "default value" for a type. Read more
impl Debug for Environment[src]
impl Debug for Environmentfn fmt(&self, f: &mut Formatter) -> Result<(), Error>[src]
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>Formats the value using the given formatter. Read more
impl Eq for Environment[src]
impl Eq for Environmentimpl PartialEq<Environment> for Environment[src]
impl PartialEq<Environment> for Environmentfn eq(&self, other: &Environment) -> bool[src]
fn eq(&self, other: &Environment) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, other: &Environment) -> bool[src]
fn ne(&self, other: &Environment) -> boolThis method tests for !=.
impl<'s, T> From<T> for Environment where
T: IntoIterator,
<T as IntoIterator>::Item: EnvironmentItem, [src]
impl<'s, T> From<T> for Environment where
T: IntoIterator,
<T as IntoIterator>::Item: EnvironmentItem, fn from(v: T) -> Environment[src]
fn from(v: T) -> EnvironmentPerforms the conversion.
impl<'a> From<&'a Environment> for Environment[src]
impl<'a> From<&'a Environment> for EnvironmentImplicit clone for ergonomics
fn from(v: &'a Environment) -> Environment[src]
fn from(v: &'a Environment) -> EnvironmentPerforms the conversion.
Auto Trait Implementations
impl Send for Environment
impl Send for Environmentimpl Sync for Environment
impl Sync for Environment