use std::future::Future;
pub trait Action {
type Future: Future<Output = Result<Self::Item, Self::Error>>;
type Item;
type Error;
fn run(&mut self) -> Self::Future;
}
impl<R, E, T: Future<Output = Result<R, E>>, F: FnMut() -> T> Action for F {
type Item = R;
type Error = E;
type Future = T;
fn run(&mut self) -> Self::Future {
self()
}
}