Struct gaol::sandbox::Command
[−]
[src]
pub struct Command { pub module_path: CString, pub args: Vec<CString>, pub env: HashMap<CString, CString>, }
Fields
module_path: CString
A path to the executable.
args: Vec<CString>
The arguments to pass.
env: HashMap<CString, CString>
The environment of the process.
Methods
impl Command
[src]
fn new<T>(module_path: T) -> Command where
T: AsRef<OsStr>,
T: AsRef<OsStr>,
Constructs a new Command
for launching the executable at path module_path
with no
arguments and no environment by default. Builder methods are provided to change these
defaults and otherwise configure the process.
fn me() -> Result<Command>
Constructs a new Command
for launching the current executable.
fn arg<'a, T>(&'a mut self, arg: T) -> &'a mut Command where
T: AsRef<OsStr>,
T: AsRef<OsStr>,
Adds an argument to pass to the program.
fn args<'a, T>(&'a mut self, args: &[T]) -> &'a mut Command where
T: AsRef<OsStr>,
T: AsRef<OsStr>,
Adds multiple arguments to pass to the program.
fn env<'a, T, U>(&'a mut self, key: T, val: U) -> &'a mut Command where
T: AsRef<OsStr>,
U: AsRef<OsStr>,
T: AsRef<OsStr>,
U: AsRef<OsStr>,
Inserts or updates an environment variable mapping.
fn spawn(&self) -> Result<Process>
Executes the command as a child process, which is returned.