pub trait AsyncCallback<'a, A1: 'a, A2: 'a, T: 'a>:
'static
+ Send
+ Sync
+ Fn(&'a mut A1, &'a A2) -> Self::Fut {
type Fut: Future<Output = T> + Send;
}
Expand description
Helper trait for async functions.
This is needed because with a simple impl Fn() -> Fut
, we can’t
express a variadic lifetime bound from the future to the function parameter.
impl AsyncFn
would allow this, but that doesn’t allow to express a Send
bound on the future.