Trait ic_pluto::router::Handler

source ·
pub trait Handler: Send + Sync + DynClone {
    // Required method
    fn handle(
        &self,
        req: HttpRequest
    ) -> Pin<Box<dyn Future<Output = Result<HttpResponse, HttpResponse>> + Send + Sync>>;
}

Required Methods§

source

fn handle( &self, req: HttpRequest ) -> Pin<Box<dyn Future<Output = Result<HttpResponse, HttpResponse>> + Send + Sync>>

Handle a request. The handler is called for requests with a matching path and method.

Implementors§

source§

impl<F, R> Handler for F
where F: Fn(HttpRequest) -> R + Send + Sync + DynClone, R: Future<Output = Result<HttpResponse, HttpResponse>> + Send + Sync + 'static,