[][src]Struct gaol::sandbox::Command

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]

pub fn new<T>(module_path: T) -> Command where
    T: AsRef<OsStr>, 
[src]

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.

pub fn me() -> Result<Command>[src]

Constructs a new Command for launching the current executable.

pub fn arg<'a, T>(&'a mut self, arg: T) -> &'a mut Command where
    T: AsRef<OsStr>, 
[src]

Adds an argument to pass to the program.

pub fn args<'a, T>(&'a mut self, args: &[T]) -> &'a mut Command where
    T: AsRef<OsStr>, 
[src]

Adds multiple arguments to pass to the program.

pub fn env<'a, T, U>(&'a mut self, key: T, val: U) -> &'a mut Command where
    T: AsRef<OsStr>,
    U: AsRef<OsStr>, 
[src]

Inserts or updates an environment variable mapping.

pub fn spawn(&self) -> Result<Process>[src]

Executes the command as a child process, which is returned.

Auto Trait Implementations

impl Send for Command

impl Sync for Command

impl Unpin for Command

impl UnwindSafe for Command

impl RefUnwindSafe for Command

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]