mirror of
https://github.com/actix/actix-extras.git
synced 2025-06-30 20:04:26 +02:00
impl HttpHandler for Box<HttpHandler> and add helper method Application::boxed() #49
This commit is contained in:
@ -54,6 +54,12 @@ pub trait HttpHandler: 'static {
|
||||
fn handle(&mut self, req: HttpRequest) -> Result<Box<HttpHandlerTask>, HttpRequest>;
|
||||
}
|
||||
|
||||
impl HttpHandler for Box<HttpHandler> {
|
||||
fn handle(&mut self, req: HttpRequest) -> Result<Box<HttpHandlerTask>, HttpRequest> {
|
||||
self.as_mut().handle(req)
|
||||
}
|
||||
}
|
||||
|
||||
pub trait HttpHandlerTask {
|
||||
|
||||
fn poll(&mut self) -> Poll<(), Error>;
|
||||
|
Reference in New Issue
Block a user