Trait command_group::UnixChildExt[][src]

pub trait UnixChildExt {
    fn signal(&mut self, sig: Signal) -> Result<()>;
}
Expand description

Unix-specific extensions to process Children.

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");
}

Implementations on Foreign Types

Implementors