Struct assert_cli::Environment[][src]

pub struct Environment { /* fields omitted */ }

Structure to deal with environment variables

Methods

impl 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_);

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());

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"))]);

Important traits for Vec<u8>

Compile Environment object

Trait Implementations

impl Clone for Environment
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Default for Environment
[src]

Returns the "default value" for a type. Read more

impl Debug for Environment
[src]

Formats the value using the given formatter. Read more

impl Eq for Environment
[src]

impl PartialEq<Environment> for Environment
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl<'s, T> From<T> for Environment where
    T: IntoIterator,
    <T as IntoIterator>::Item: EnvironmentItem
[src]

Performs the conversion.

impl<'a> From<&'a Environment> for Environment
[src]

Implicit clone for ergonomics

Performs the conversion.

Auto Trait Implementations

impl Send for Environment

impl Sync for Environment