pub struct ProcessSpec {Show 13 fields
pub program: OsString,
pub args: Vec<OsString>,
pub env: Vec<(OsString, OsString)>,
pub env_clear: bool,
pub cwd: Option<PathBuf>,
pub stdio: [ProcessStdio; 3],
pub extra: Vec<ChildFd>,
pub uid: Option<u32>,
pub gid: Option<u32>,
pub new_process_group: bool,
pub windows_hide: bool,
pub detached: bool,
pub controlling_terminal: bool,
}Expand description
Child launch options. Arguments exclude argv[0], which is the program name.
Environment entries override inherited values unless env_clear is true.
Fields§
§program: OsStringExecutable path or name resolved using PATH.
args: Vec<OsString>Arguments after argv[0].
env: Vec<(OsString, OsString)>Environment additions or overrides.
env_clear: boolStart from an empty environment.
cwd: Option<PathBuf>Child working directory; None inherits the host directory.
stdio: [ProcessStdio; 3]Child stdin, stdout and stderr, in that order.
extra: Vec<ChildFd>Additional child descriptors beyond stdin/stdout/stderr, at fixed child
descriptor numbers. This is the tail of Node’s stdio array: entry
stdio[3] of ['pipe','pipe','pipe','ipc'] is ChildFd number 3.
Empty by default; Driver::spawn refuses a
non-empty list, because the parent ends have nowhere to go. Use
Driver::spawn_extra.
uid: Option<u32>Unix user ID; unsupported platforms reject this option.
gid: Option<u32>Unix group ID; unsupported platforms reject this option.
new_process_group: boolCreate an isolated process group (Windows Job Object) for tree termination.
windows_hide: boolHide child windows on Windows (Node’s windowsHide); ignored elsewhere.
Defaults to false. With inherited stdio the console stays attached, even
when true; with only pipes/null streams Windows uses CREATE_NO_WINDOW.
detached: boolPrepare the child to outlive the parent process (Node’s detached).
Windows creates a detached process group and excludes it from the parent’s
lifetime job; Unix creates a new session and process group. Defaults false.
This does not unref the child or change turnloop’s explicit ownership:
closing the child or dropping its owning loop still terminates a live child.
controlling_terminal: boolMake the child’s stdin its controlling terminal (Unix TIOCSCTTY), which
is what a pty child needs so that job control, /dev/tty and terminal
signals work inside it. Requires detached, because only a session leader
with no controlling terminal may claim one; without it the spawn is
InvalidInput. Windows has no equivalent and reports Unsupported.
Defaults to false.