HandlerFn

Trait HandlerFn 

Source
pub trait HandlerFn {
    // Required method
    fn call(&self, req: Request) -> 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: Request) -> Box<dyn Response>

Implementors§

Source§

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