use alloc::boxed::Box;
mod exit;
pub use self::exit::{ExitError, ExitException, ExitFatal, ExitResult, ExitSucceed};
#[derive(Debug, Eq, PartialEq)]
pub enum Capture<E, T> {
Exit(E),
Trap(Box<T>),
}
impl<E, T> Capture<E, T> {
pub fn exit(self) -> Option<E> {
match self {
Self::Exit(e) => Some(e),
Self::Trap(_) => None,
}
}
pub fn trap(self) -> Option<Box<T>> {
match self {
Self::Exit(_) => None,
Self::Trap(t) => Some(t),
}
}
}