use std::{marker::Destruct, 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
}}
}
const impl<Type: [const] Destruct> Act<Type> {
#[inline]
pub fn map<Return, Closure: [const] FnOnce(Type) -> Return + [const] Destruct>(self, closure: Closure) -> Act<Return> {return Act {
option: self.option.map(closure)
}}
#[inline]
pub fn value(self) -> Option<Type> {return self.option}
}