[][src]Struct assert_cmd::stdin::StdInCommand

pub struct StdInCommand<'a> { /* fields omitted */ }

Command that carries the stdin buffer.

Create a StdInCommand through the CommandStdInExt trait.

Examples

use assert_cmd::prelude::*;

use std::process::Command;

let mut cmd = Command::new("cat");
cmd
    .arg("-et");
cmd
    .with_stdin()
    .buffer("42")
    .assert()
    .stdout("42");

Methods

impl<'a> StdInCommand<'a>[src]

pub fn output(&mut self) -> Result<Output>[src]

Executes the Command as a child process, waiting for it to finish and collecting all of its output.

By default, stdout and stderr are captured (and used to provide the resulting output). Stdin is not inherited from the parent and any attempt by the child process to read from the stdin stream will result in the stream immediately closing.

(mirrors Command::output)

Trait Implementations

impl<'c> OutputAssertExt for &'c mut StdInCommand<'c>[src]

impl<'c, 'a> OutputOkExt for &'c mut StdInCommand<'a>[src]

fn unwrap(self) -> Output[src]

Unwrap a [Output][Output] but with a prettier message than .ok().unwrap(). Read more

impl<'a> Debug for StdInCommand<'a>[src]

Auto Trait Implementations

impl<'a> Send for StdInCommand<'a>

impl<'a> !Sync for StdInCommand<'a>

Blanket Implementations

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.