Struct cradle::Stderr[][src]

pub struct Stderr(pub String);
Expand description

See the CmdOutput implementation for Stderr below.

Trait Implementations

Formats the value using the given formatter. Read more

Stderr allows to capture the stderr of a child process:

use cradle::*;

// (`Exit` is used here to suppress panics caused by `ls`
// terminating with a non-zero exit code.)
let (Stderr(stderr), Exit(_)) = cmd!(%"ls does-not-exist");
assert!(stderr.contains("No such file or directory"));

This assumes that the output written to stderr is encoded as utf-8, and will error otherwise.

By default, what is written to stderr by the child process is relayed to the parent’s stderr. However, when Stderr is used, this is switched off.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.