Struct cradle::Stderr [−][src]
pub struct Stderr(pub String);
Expand description
Stderr
allows to capture the stderr
of a child process:
use cradle::*; // (`Status` is used here to suppress panics caused by `ls` // terminating with a non-zero exit code.) let (Stderr(stderr), Status(_)) = 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.