Trait command_group::UnixChildExt [−][src]
Expand description
Unix-specific extensions to process Child
ren.
Required methods
Sends a signal to the child process. If the process has already exited, an InvalidInput
error is returned.
Examples
Basic usage:
use std::process::Command; use command_group::{UnixChildExt, Signal}; let mut command = Command::new("yes"); if let Ok(mut child) = command.spawn() { child.signal(Signal::SIGTERM).expect("command wasn't running"); } else { println!("yes command didn't start"); }
With a process group:
use std::process::Command; use command_group::{CommandGroup, UnixChildExt, Signal}; let mut command = Command::new("yes"); if let Ok(mut child) = command.group_spawn() { child.signal(Signal::SIGTERM).expect("command wasn't running"); } else { println!("yes command didn't start"); }