cargo_test_support

Trait TestEnvCommandExt

Source
pub trait TestEnvCommandExt: Sized {
    // Required methods
    fn current_dir<S: AsRef<Path>>(self, path: S) -> Self;
    fn env<S: AsRef<OsStr>>(self, key: &str, value: S) -> Self;
    fn env_remove(self, key: &str) -> Self;

    // Provided method
    fn test_env(self) -> Self { ... }
}
Expand description

Establish a process’s test environment

Required Methods§

Source

fn current_dir<S: AsRef<Path>>(self, path: S) -> Self

Source

fn env<S: AsRef<OsStr>>(self, key: &str, value: S) -> Self

Source

fn env_remove(self, key: &str) -> Self

Provided Methods§

Source

fn test_env(self) -> Self

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl TestEnvCommandExt for Command

Source§

fn current_dir<S: AsRef<Path>>(self, path: S) -> Self

Source§

fn env<S: AsRef<OsStr>>(self, key: &str, value: S) -> Self

Source§

fn env_remove(self, key: &str) -> Self

Implementors§