pub struct Command(Command);Expand description
A wrapper around the command API of the underlying async runtime.
Unlike the socket transports, unixexec isn’t run-time selected: async-process is used
whenever it’s compiled in (its pipes are Async<_>, which any runtime can drive), so with both
backends a tokio app connecting over unixexec: picks up async-io’s reactor.
Tuple Fields§
§0: CommandImplementations§
Source§impl Command
impl Command
Sourcepub fn new<S>(program: S) -> Self
pub fn new<S>(program: S) -> Self
Constructs a new Command for launching the program at path program.
Sourcepub fn for_unixexec(unixexec: &Unixexec) -> Self
pub fn for_unixexec(unixexec: &Unixexec) -> Self
Constructs a new Command from a unixexec address.
Sourcepub fn arg0<S>(&mut self, arg: S) -> &mut Self
pub fn arg0<S>(&mut self, arg: S) -> &mut Self
Sets executable argument.
Set the first process argument, argv[0], to something other than the
default executable path.
Sourcepub fn args<I, S>(&mut self, args: I) -> &mut Self
pub fn args<I, S>(&mut self, args: I) -> &mut Self
Adds multiple arguments to pass to the program.
Sourcepub async fn output(&mut self) -> Result<Output, Error>
pub async fn output(&mut self) -> Result<Output, Error>
Executes the command as a child process, waiting for it to finish and collecting all of its output.
Sourcepub fn stdin<T: Into<Stdio>>(&mut self, cfg: T) -> &mut Self
pub fn stdin<T: Into<Stdio>>(&mut self, cfg: T) -> &mut Self
Sets configuration for the child process’s standard input (stdin) handle.
Sourcepub fn stdout<T: Into<Stdio>>(&mut self, cfg: T) -> &mut Self
pub fn stdout<T: Into<Stdio>>(&mut self, cfg: T) -> &mut Self
Sets configuration for the child process’s standard output (stdout) handle.