[][src]Trait process_control::Timeout

pub trait Timeout: Sealed {
    type Result;
#[must_use]    fn strict_errors(self) -> Self;
#[must_use] fn terminating(self) -> Self;
fn wait(self) -> Result<Option<Self::Result>>; }

A temporary wrapper for a process timeout.

Associated Types

type Result

The type returned by wait.

Loading content...

Required methods

#[must_use]fn strict_errors(self) -> Self

Causes wait to never suppress an error.

Typically, errors terminating the process will be ignored, as they are often less important than the result. However, when this method is called, those errors will be returned as well.

#[must_use]fn terminating(self) -> Self

Causes the process to be terminated if it exceeds the time limit.

Process identifier reuse by the system will be mitigated. There should never be a scenario that causes an unintended process to be terminated.

fn wait(self) -> Result<Option<Self::Result>>

Runs the process to completion, aborting if it exceeds the time limit.

At least one thread will be created to wait on the process without blocking the current thread.

If the time limit is exceeded before the process finishes, Ok(None) will be returned. However, the process will not be terminated in that case unless terminating is called beforehand. It is recommended to always call that method to allow system resources to be freed.

The stdin handle to the process, if it exists, will be closed before waiting. Otherwise, the process would assuredly time out when reading from that pipe.

This method cannot guarantee that the same ErrorKind variants will be returned in the future for the same types of failures. Allowing these breakages is required to be compatible with the Error type.

Loading content...

Implementors

Loading content...