Struct assert_cli::Environment [−][src]
pub struct Environment { /* fields omitted */ }
Structure to deal with environment variables
Methods
impl Environment
[src]
impl Environment
pub fn inherit() -> Environment
[src]
pub fn inherit() -> Environment
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_);
pub fn empty() -> Environment
[src]
pub fn empty() -> Environment
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());
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 Environment
fn clone(&self) -> Environment
[src]
fn clone(&self) -> Environment
Returns 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 Environment
fn default() -> Environment
[src]
fn default() -> Environment
Returns the "default value" for a type. Read more
impl Debug for Environment
[src]
impl Debug for Environment
fn 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 Environment
impl PartialEq<Environment> for Environment
[src]
impl PartialEq<Environment> for Environment
fn eq(&self, other: &Environment) -> bool
[src]
fn eq(&self, other: &Environment) -> bool
This 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) -> bool
This 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) -> Environment
Performs the conversion.
impl<'a> From<&'a Environment> for Environment
[src]
impl<'a> From<&'a Environment> for Environment
Implicit clone for ergonomics
fn from(v: &'a Environment) -> Environment
[src]
fn from(v: &'a Environment) -> Environment
Performs the conversion.
Auto Trait Implementations
impl Send for Environment
impl Send for Environment
impl Sync for Environment
impl Sync for Environment