doc.rust-lang.org
pub fn success(&self) -> bool
Was termination successful? Signal termination is not considered a success, and success is defined as a zero exit status.
method
std
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn code(&self) -> Option<i32>
Returns the exit code of the process, if any.
method
std
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub struct ExitStatus
Describes the result of a process after it has terminated.
struct
std
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
const SUCCESS: ExitCode
The canonical ExitCode for successful termination on this platform.
associated_constant
std
Stable since 1.61.0
Version 1.100.0-nightly
doc.rust-lang.org
const FAILURE: ExitCode
The canonical ExitCode for unsuccessful termination on this platform.
associated_constant
std
Stable since 1.61.0
Version 1.100.0-nightly
doc.rust-lang.org
pub struct ExitCode
This type represents the status code the current process can return to its parent under normal termination.
struct
std
Stable since 1.61.0
Version 1.100.0-nightly
doc.rust-lang.org
pub struct CommandEnvs<'a>
An iterator over the command environment variables.
struct
std
Stable since 1.57.0
Version 1.100.0-nightly
doc.rust-lang.org
pub struct CommandArgs<'a>
An iterator over the command arguments.
struct
std
Stable since 1.57.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn stdout<T>(&mut self, cfg: T) -> &mut Command
Configuration for the child process's standard output (stdout) handle.
method
std
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn stdin<T>(&mut self, cfg: T) -> &mut Command
Configuration for the child process's standard input (stdin) handle.
method
std
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn stderr<T>(&mut self, cfg: T) -> &mut Command
Configuration for the child process's standard error (stderr) handle.
method
std
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn status(&mut self) -> io::Result<ExitStatus>
Executes a command as a child process, waiting for it to finish and collecting its status.
method
std
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn spawn(&mut self) -> io::Result<Child>
Executes the command as a child process, returning a handle to it.
method
std
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn output(&mut self) -> io::Result<Output>
Executes the command as a child process, waiting for it to finish and collecting all of its output.
method
std
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn new<S>(program: S) -> Command
Constructs a new Command for launching the program at path program, with the following default configuration:
associated_function
std
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn get_program(&self) -> &OsStr
Returns the path to the program that was given to Command::new.
method
std
Stable since 1.57.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn get_envs(&self) -> CommandEnvs<'_>
Returns an iterator of the environment variables explicitly set for the child process.
method
std
Stable since 1.57.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn get_current_dir(&self) -> Option<&Path>
Returns the working directory for the child process.
method
std
Stable since 1.57.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn get_args(&self) -> CommandArgs<'_>
Returns an iterator of the arguments that will be passed to the program.
method
std
Stable since 1.57.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn envs<I, K, V>(&mut self, vars: I) -> &mut Command
Inserts or updates multiple explicit environment variable mappings.
method
std
Stable since 1.19.0
Version 1.100.0-nightly