Trait xitca_web::service::AsyncClosure
source · pub trait AsyncClosure<Arg> {
type Output;
type Future: Future<Output = Self::Output>;
// Required method
fn call(&self, arg: Arg) -> Self::Future;
}Expand description
Same as std::ops::Fn trait but for async output.
It is necessary in the the HRTB bounds for async fn’s with reference parameters because it
allows the output future to be bound to the parameter lifetime.
F: for<'a> AsyncClosure<(&'a u8,) Output=u8>