rstd 0.1.0
Loading...
Searching...
No Matches
rstd::process::Command Class Referenceexport
module rstd

A process builder, providing fine-grained control over how a new process should be spawned. More...

Public Member Functions

auto arg (const char *a) -> Command &
 Adds an argument to pass to the program.
 
auto env (const char *key, const char *value) -> Command &
 Sets an environment variable for the child process.
 
auto env_remove (const char *key) -> Command &
 Removes an environment variable for the child process.
 
auto env_clear () -> Command &
 Clears all environment variables for the child process.
 
auto current_dir (const char *dir) -> Command &
 Sets the working directory for the child process.
 
auto set_stdin (Stdio s) -> Command &
 Configures the child process's standard input.
 
auto set_stdout (Stdio s) -> Command &
 Configures the child process's standard output.
 
auto set_stderr (Stdio s) -> Command &
 Configures the child process's standard error.
 
auto spawn () -> io::Result< Child >
 Spawns the child process.
 
auto status () -> io::Result< ExitStatus >
 Executes the command and waits for it to finish, returning the exit status.
 
auto output () -> io::Result< Output >
 Executes the command, waits for it, and collects stdout/stderr.
 

Static Public Member Functions

static auto make (const char *program) -> Command
 Creates a new Command for the given program.
 

Detailed Description

A process builder, providing fine-grained control over how a new process should be spawned.

Analogous to Rust's std::process::Command.

Member Function Documentation

◆ make()

static auto rstd::process::Command::make ( const char * program) -> Command
inlinestaticexport

Creates a new Command for the given program.

Parameters
programPath or name of the program to execute.

The documentation for this class was generated from the following file: