Module cradle::output [−][src]
Expand description
The Output
trait that defines all possible outputs of a child process.
Structs
Use Status
as the return type for run_output!
to retrieve the
ExitStatus
of the child process:
Stderr
allows to capture the stderr
of a child process:
Returns what the child process writes to stdout
, interpreted as utf-8,
collected into a string, trimmed of leading and trailing whitespace.
This also suppresses output of the child’s stdout
to the parent’s stdout
. (Which would be the default when not using StdoutTrimmed
as the return value.)
Same as StdoutTrimmed
, but does not trim whitespace from the output:
Traits
All possible return types of run!
, run_output!
or
run_result!
must implement this trait.
This return-type polymorphism makes cradle very flexible.
For example, if you want to capture what a command writes
to stdout
you can do that using StdoutUntrimmed
: