Struct assert_cli::Environment
[−]
[src]
pub struct Environment { /* fields omitted */ }
Structure to deal with environment variables
Methods
impl Environment
[src]
fn inherit() -> Environment
[src]
Create 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_);
fn empty() -> Environment
[src]
Create 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());
fn insert<S1, S2>(self, key: S1, val: S2) -> Environment where
S1: Into<OsString>,
S2: Into<OsString>,
[src]
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"))]);
fn compile(self) -> Vec<(OsString, OsString)>
[src]
Compile Environment object
Trait Implementations
impl Clone for Environment
[src]
fn clone(&self) -> Environment
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Eq for Environment
[src]
impl<'a> From<&'a Environment> for Environment
[src]
Implicit clone for ergonomics
fn from(v: &'a Environment) -> Environment
[src]
Performs the conversion.
impl<'s, T> From<T> for Environment where
T: IntoIterator,
<T as IntoIterator>::Item: EnvironmentItem,
[src]
T: IntoIterator,
<T as IntoIterator>::Item: EnvironmentItem,
fn from(v: T) -> Environment
[src]
Performs the conversion.
impl PartialEq<Environment> for Environment
[src]
fn eq(&self, __arg_0: &Environment) -> bool
[src]
fn ne(&self, __arg_0: &Environment) -> bool
[src]
impl Debug for Environment
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result<(), Error>
[src]
Formats the value using the given formatter.
impl Default for Environment
[src]
fn default() -> Environment
[src]
Returns the "default value" for a type. Read more