Crate process_guard[][src]

Process guard

A process guard takes ownership of a process::Child and gently or forcefully kills it upon, prevent the process from running on. Example:

use process_guard::ProcessGuard;
use std::process;

fn insomnia() {
    let pg = ProcessGuard::spawn(process::Command::new("sleep").arg("120"));

    // a two-minute sleep process has been started, which will be killed as soon as this
    // function returns
}

Structs

ProcessGuard

Protects a process from becoming an orphan or zombie by killing it when the guard is dropped