implement Endpoint trait for Box<dyn Endpoint>
@@ -118,3 +118,10 @@ where
Ok(next.run(req).await)
}
}
+
+#[async_trait]
+impl<State: Clone + Send + Sync + 'static> Endpoint<State> for Box<dyn Endpoint<State>> {
+ async fn call(&self, request: Request<State>) -> crate::Result {
+ self.call(request).await
+ }
+}
