Struct assert_cmd::output::OutputError[][src]

pub struct OutputError { /* fields omitted */ }

Command error.

Generally produced by OutputOkExt.

Examples

use assert_cmd::prelude::*;

use std::process::Command;

let err = Command::new("a-command")
    .args(&["--will-fail"])
    .unwrap_err();

Implementations

impl OutputError[src]

pub fn new(output: Output) -> Self[src]

Convert Output into an Error.

pub fn with_cause<E>(cause: E) -> Self where
    E: Error + Send + Sync + 'static, 
[src]

For errors that happen in creating a Output.

pub fn set_cmd(mut self: Self, cmd: String) -> Self[src]

Add the command line for additional context.

pub fn set_stdin(mut self: Self, stdin: Vec<u8>) -> Self[src]

Add the stdin for additional context.

pub fn as_output(&self) -> Option<&Output>[src]

Access the contained Output.

Examples

use assert_cmd::prelude::*;

use std::process::Command;

let err = Command::new("a-command")
    .args(&["--will-fail"])
    .unwrap_err();
let output = err
    .as_output()
    .unwrap();
assert_eq!(Some(42), output.status.code());

Trait Implementations

impl Debug for OutputError[src]

impl Display for OutputError[src]

impl Error for OutputError[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

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

impl<T> ToString for T where
    T: Display + ?Sized
[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.