Skip to content

Commit

Permalink
Merge pull request #710 from mendelt/boxed_endpoint
Browse files Browse the repository at this point in the history
implement Endpoint trait for Box<dyn Endpoint>
  • Loading branch information
yoshuawuyts authored Sep 28, 2020
2 parents 563091e b825cc7 commit fd6ba06
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/endpoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

0 comments on commit fd6ba06

Please sign in to comment.