use alloc::boxed::Box;
use core::future::Future;
use core::pin::Pin;
pub type BoxFuture<'a, T> = Pin<Box<dyn Future<Output = T> + Send + 'a>>;
pub trait BinderAsyncPool {
fn spawn<'a, F1, F2, Fut, A, B, E>(
spawn_me: F1,
after_spawn: F2,
) -> BoxFuture<'a, Result<B, E>>
where
F1: FnOnce() -> A,
F2: FnOnce(A) -> Fut,
Fut: Future<Output = Result<B, E>>,
F1: Send + 'static,
F2: Send + 'a,
Fut: Send + 'a,
A: Send + 'static,
B: Send + 'a,
E: From<crate::StatusCode>;
}
pub trait BinderAsyncRuntime {
fn block_on<F: Future>(&self, future: F) -> F::Output;
}