Struct cradle::output::Stderr[][src]

pub struct Stderr(pub String);
Expand description

Stderr allows to capture the stderr of a child process:

use cradle::prelude::*;

// (`Status` is used here to suppress panics caused by `ls`
// terminating with a non-zero exit code.)
let (Stderr(stderr), Status(_)) = run_output!(%"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.

Tuple Fields

0: String

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

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 resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

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.