#[cfg(test)]
mod tests;
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[non_exhaustive]
pub enum Outcome {
Ended(Status),
TimedOut,
Stopped(StopReason),
}
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[non_exhaustive]
pub enum StopReason {
Cancelled,
OverLimit,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[non_exhaustive]
pub enum Status {
Code(i32),
Signal(i32),
}
impl Status {
#[must_use]
pub const fn shell_code(self) -> i32 {
match self {
Self::Code(code) => code,
Self::Signal(signal) => 128 + signal,
}
}
}