pub enum ProcessEnd {
Success,
ExitError(NonZeroI64),
ExitSignal(Signal),
ExitStop(NonZeroI32),
Exception(NonZeroI32),
Continued,
}Expand description
The end status of a process.
This is a sort-of equivalent of the std::process::ExitStatus type which, while
constructable, differs on various platforms. The native type is an integer that is interpreted
either through convention or via platform-dependent libc or kernel calls; our type is a more
structured representation for the purpose of being clearer and transportable.
On Unix, one can tell whether a process dumped core from the exit status; this is not replicated
in this structure; if that’s desirable you can obtain it manually via libc::WCOREDUMP and the
ExitSignal variant.
On Unix and Windows, the exit status is a 32-bit integer; on Fuchsia it’s a 64-bit integer. For
portability, we use i64. On all platforms, the “success” value is zero, so we special-case
that as a variant and use NonZeroI* to limit the other values.
Variants§
Success
The process ended successfully, with exit status = 0.
ExitError(NonZeroI64)
The process exited with a non-zero exit status.
ExitSignal(Signal)
The process exited due to a signal.
ExitStop(NonZeroI32)
The process was stopped (but not terminated) (libc::WIFSTOPPED).
Exception(NonZeroI32)
The process suffered an unhandled exception or warning (typically Windows only).
Continued
The process was continued (libc::WIFCONTINUED).
Implementations§
Source§impl ProcessEnd
impl ProcessEnd
Sourcepub fn into_exitstatus(self) -> ExitStatus
pub fn into_exitstatus(self) -> ExitStatus
Convert a ProcessEnd to an ExitStatus.
This is a testing function only! It will panic if the ProcessEnd is not representable
as an ExitStatus on Unix. This is also not guaranteed to be accurate, as the waitpid()
status union is platform-specific. Exit codes and signals are implemented, other variants
are not.
Trait Implementations§
Source§impl Clone for ProcessEnd
impl Clone for ProcessEnd
Source§fn clone(&self) -> ProcessEnd
fn clone(&self) -> ProcessEnd
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more