use std::future::Future;
pub type BAM<'se, T, R> = Box<dyn Fn(T) -> Box<dyn Future<Output = R> + 'se> + 'se>;
pub trait IntoBAM<'se, T, R> {
fn into_bam(self) -> BAM<'se, T, R>;
}
impl<'se, T, R, C, Fut> IntoBAM<'se, T, R> for C
where
C: Fn(T) -> Fut + 'se,
Fut: Future<Output = R> + 'se,
{
fn into_bam(self) -> BAM<'se, T, R> {
Box::new(move |parameter: T| Box::new(self(parameter)))
}
}