Trait ExitStatusExt
trait ExitStatusExt: Sealed
Unix-specific extensions to process::ExitStatus and
ExitStatusError.
On Unix, ExitStatus does not necessarily represent an exit status, as
passed to the _exit system call or returned by
ExitStatus::code(). It represents any wait status
as returned by one of the wait family of system
calls.
A Unix wait status (a Rust ExitStatus) can represent a Unix exit status, but can also
represent other kinds of process event.
This trait is sealed: it cannot be implemented outside the standard library. This is so that future additional methods are not breaking changes.
Required Methods
fn from_raw(raw: i32) -> SelfCreates a new
ExitStatusorExitStatusErrorfrom the raw underlying integer status value fromwaitThe value should be a wait status, not an exit status.
Panics
Panics on an attempt to make an
ExitStatusErrorfrom a wait status of0.Making an
ExitStatusalways succeeds and never panics.fn signal(self: &Self) -> Option<i32>If the process was terminated by a signal, returns that signal.
In other words, if
WIFSIGNALED, this returnsWTERMSIG.fn core_dumped(self: &Self) -> boolIf the process was terminated by a signal, says whether it dumped core.
fn stopped_signal(self: &Self) -> Option<i32>If the process was stopped by a signal, returns that signal.
In other words, if
WIFSTOPPED, this returnsWSTOPSIG. This is only possible if the status came from awaitsystem call which was passedWUNTRACED, and was then converted into anExitStatus.fn continued(self: &Self) -> boolWhether the process was continued from a stopped status.
Ie,
WIFCONTINUED. This is only possible if the status came from awaitsystem call which was passedWCONTINUED, and was then converted into anExitStatus.fn into_raw(self: Self) -> i32Returns the underlying raw
waitstatus.The returned integer is a wait status, not an exit status.
Implementors
impl ExitStatusExt for process::ExitStatusimpl ExitStatusExt for process::ExitStatusError