Output in std::process - Rust (original) (raw)

Struct Output

1.0.0 · Source

pub struct Output {
    pub status: ExitStatus,
    pub stdout: Vec<u8>,
    pub stderr: Vec<u8>,
}

Expand description

The status (exit code) of the process.

The data that the process wrote to stdout.

The data that the process wrote to stderr.

Source§

Source

🔬This is a nightly-only experimental API. (exit_status_error #84908)

Returns an error if a nonzero exit status was received.

If the Command exited successfully,self is returned.

This is equivalent to calling exit_okon Output.status.

Note that this will throw away the Output::stderr field in the error case. If the child process outputs useful informantion to stderr, you can:

§Examples
#![feature(exit_status_error)]
use std::process::Command;
assert!(Command::new("false").output().unwrap().exit_ok().is_err());

1.0.0 · Source§

1.7.0 · Source§

1.0.0 · Source§

Source§

Tests for self and other values to be equal, and is used by ==.

1.0.0 · Source§

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

1.0.0 · Source§

1.0.0 · Source§

§

§

§

§

§

§