logo
pub enum Process {
    None,
    Grouped(AsyncGroupChild),
    Ungrouped(Child),
    Done(ExitStatus),
}
Expand description

Low-level wrapper around a process child, be it grouped or ungrouped.

Variants

None

The initial state of the process, before it’s spawned.

Grouped(AsyncGroupChild)

A grouped process that’s been spawned.

Ungrouped(Child)

An ungrouped process that’s been spawned.

Done(ExitStatus)

The cached exit status of the process.

Implementations

Sends a Unix signal to the process.

Does nothing if the process is not running.

Kills the process.

Does nothing if the process is not running.

Note that this has different behaviour for grouped and ungrouped processes due to Tokio’s API: it waits on ungrouped processes, but not for grouped processes.

Checks the status of the process.

Returns true if the process is still running.

This takes &mut self as it transitions the Process state to Process::Done if it finds the process has ended, such that it will cache the exit status. Otherwise that status would be lost.

Does nothing and returns false immediately if the Process is Done or None.

Waits for the process to exit, and returns its exit status.

This takes &mut self as it transitions the Process state to Process::Done if it finds the process has ended, such that it will cache the exit status.

This makes it possible to call wait on a process multiple times, without losing the exit status.

Returns immediately with the cached exit status if the Process is Done, and with None if the Process is None.

Trait Implementations

Formats the value using the given formatter. Read more

Returns Process::None.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more