Struct cradle::Stderr [−][src]
pub struct Stderr(pub String);
Trait Implementations
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
impl RefUnwindSafe for Stderr
impl UnwindSafe for Stderr