Trait ProcessSpawner
pub trait ProcessSpawner: Send + Sync {
type Context: LaunchContext;
type Handle: Send + 'static;
type Error: Error + Send + Sync + 'static;
// Required method
fn spawn(
&self,
program: &OsStr,
args: &[OsString],
context: &Self::Context,
) -> Result<Self::Handle, Self::Error>;
}Expand description
Spawns child processes (daemon, client consoles, plugin hosts) on the host platform.
Required Associated Types§
type Context: LaunchContext
type Context: LaunchContext
Per-spawn context type; see LaunchContext.
Required Methods§
fn spawn(
&self,
program: &OsStr,
args: &[OsString],
context: &Self::Context,
) -> Result<Self::Handle, Self::Error>
fn spawn( &self, program: &OsStr, args: &[OsString], context: &Self::Context, ) -> Result<Self::Handle, Self::Error>
Spawn program with args under the supplied context.
§Arguments
program- Executable to launch (absolute path or aPATH-resolvable name).args- Command-line arguments passed to the child.context- Platform-specific launch context.
§Returns
Platform-specific handle to the spawned process, or a platform error if the spawn failed.