Skip to main content

HandlerFn

Trait HandlerFn 

Source
pub trait HandlerFn: Send + Sync {
    // Required method
    fn call(&self, req: HttpRequest) -> Box<dyn Response>;
}
Expand description

A generic trait to allow many different types of handlers to be passed into our http server

Required Methods§

Source

fn call(&self, req: HttpRequest) -> Box<dyn Response>

Implementors§

Source§

impl<F, T> HandlerFn for F
where F: Fn(HttpRequest) -> T + Send + Sync, T: Response + 'static,