use std::process::{
ExitCode,
Termination
};
pub struct Act<Type> {
option: Option<Type>
}
impl Termination for Act<()> {
fn report(self) -> ExitCode {return match self.option {
None => ExitCode::FAILURE,
Some(()) => ExitCode::SUCCESS
}}
}
impl<Type> Act<Type> {
#[inline]
pub fn map<Return, Closure: FnOnce(Type) -> Return>(self, closure: Closure) -> Act<Return> {return Act {
option: self.option.map(closure)
}}
#[inline]
pub fn value(self) -> Option<Type> {return self.option}
}