Struct process_guard::ProcessGuard[][src]

pub struct ProcessGuard { /* fields omitted */ }

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

Methods

impl ProcessGuard
[src]

Create a new child process

unsafe

It is unsafe to put any arbitrary child process into a process guard, mainly because the guard relies on the child not having been waited on beforehand. Otherwise, it cannot be guaranteed that the child process has not exited and its PID been reused, potentially killing an innocent bystander process on Drop.

Retrieves the child process from the process guard

Spawns a command

Equivalent to calling cmd.spawn(), followed by new.

Spawns a command with a grace timeout

Equivalent to calling cmd.spawn(), followed by new.

Shut the process down

Calling shutdown() on a guard whose process has already exited is a no-op. Note that a process whose shutdown failed is also considered shutdown, even though it might still be running.

Trait Implementations

impl Debug for ProcessGuard
[src]

Formats the value using the given formatter. Read more

impl Drop for ProcessGuard
[src]

Executes the destructor for this type. Read more

Auto Trait Implementations