Trait CommandExtra

Source
pub trait CommandExtra: Sized {
    // Required methods
    fn with_current_dir(self, dir: impl AsRef<Path>) -> Self;
    fn with_env(self, key: impl AsRef<OsStr>, value: impl AsRef<OsStr>) -> Self;
    fn without_env(self, key: impl AsRef<OsStr>) -> Self;
    fn with_no_env(self) -> Self;
    fn with_arg(self, arg: impl AsRef<OsStr>) -> Self;
    fn with_stdin(self, stdio: Stdio) -> Self;
    fn with_stdout(self, stdio: Stdio) -> Self;
    fn with_stderr(self, stdio: Stdio) -> Self;

    // Provided method
    fn with_args<Args>(self, args: Args) -> Self
       where Args: IntoIterator,
             Args::Item: AsRef<OsStr> { ... }
}

Required Methods§

Source

fn with_current_dir(self, dir: impl AsRef<Path>) -> Self

Source

fn with_env(self, key: impl AsRef<OsStr>, value: impl AsRef<OsStr>) -> Self

Source

fn without_env(self, key: impl AsRef<OsStr>) -> Self

Source

fn with_no_env(self) -> Self

Source

fn with_arg(self, arg: impl AsRef<OsStr>) -> Self

Source

fn with_stdin(self, stdio: Stdio) -> Self

Source

fn with_stdout(self, stdio: Stdio) -> Self

Source

fn with_stderr(self, stdio: Stdio) -> Self

Provided Methods§

Source

fn with_args<Args>(self, args: Args) -> Self
where Args: IntoIterator, Args::Item: AsRef<OsStr>,

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 CommandExtra for Command

Source§

fn with_current_dir(self, dir: impl AsRef<Path>) -> Self

Source§

fn with_env(self, key: impl AsRef<OsStr>, value: impl AsRef<OsStr>) -> Self

Source§

fn without_env(self, key: impl AsRef<OsStr>) -> Self

Source§

fn with_no_env(self) -> Self

Source§

fn with_arg(self, arg: impl AsRef<OsStr>) -> Self

Source§

fn with_stdin(self, stdio: Stdio) -> Self

Source§

fn with_stdout(self, stdio: Stdio) -> Self

Source§

fn with_stderr(self, stdio: Stdio) -> Self

Implementors§