Trait HttpService

Source
pub trait HttpService: UnwindSafe {
    // Required method
    fn handle_request(
        &self,
        _req: Request<Vec<u8>>,
    ) -> Result<Response<Vec<u8>>, Box<dyn Error>>;
}
Available on crate feature http only.
Expand description

A trait for request handlers that uses types from the http crate.

Handlers that implement this trait can be used with the HttpHandler adapter to convert them to a UnitService.

Required Methods§

Source

fn handle_request( &self, _req: Request<Vec<u8>>, ) -> Result<Response<Vec<u8>>, Box<dyn Error>>

Implementors§

Source§

impl<F> HttpService for F
where F: Fn(Request<Vec<u8>>) -> Result<Response<Vec<u8>>, Box<dyn Error>> + UnwindSafe + 'static,