Struct command_group::builder::CommandGroupBuilder
source · pub struct CommandGroupBuilder<'a, T> { /* private fields */ }
Expand description
CommandGroupBuilder is a builder for a group of processes.
It is created via the group
method on Command
or
AsyncCommand
.
Implementations§
source§impl CommandGroupBuilder<'_, Command>
impl CommandGroupBuilder<'_, Command>
sourcepub fn spawn(&mut self) -> Result<GroupChild>
pub fn spawn(&mut self) -> Result<GroupChild>
Executes the command as a child process group, returning a handle to it.
By default, stdin, stdout and stderr are inherited from the parent.
On Windows, this creates a job object instead of a POSIX process group.
Examples
Basic usage:
use std::process::Command;
use command_group::CommandGroup;
Command::new("ls")
.group()
.spawn()
.expect("ls command failed to start");
source§impl CommandGroupBuilder<'_, Command>
impl CommandGroupBuilder<'_, Command>
sourcepub fn spawn(&mut self) -> Result<AsyncGroupChild>
pub fn spawn(&mut self) -> Result<AsyncGroupChild>
Executes the command as a child process group, returning a handle to it.
By default, stdin, stdout and stderr are inherited from the parent.
On Windows, this creates a job object instead of a POSIX process group.
Examples
Basic usage:
use tokio::process::Command;
use command_group::CommandGroup;
Command::new("ls")
.group()
.spawn()
.expect("ls command failed to start");