pub trait HttpRequest {
    // Required method
    fn request(
        &mut self,
        req: Request<Body>
    ) -> BoxFuture<'_, Result<Response<Vec<u8>>, Error>>;
}
Expand description

A trait for providing HTTP capabilities to the StateMachine.

This trait is a wrapper around Hyper, to provide a simple request->response style of API for the state machine to use.

In particular, it’s meant to be easy to mock for tests.

Required Methods§

source

fn request( &mut self, req: Request<Body> ) -> BoxFuture<'_, Result<Response<Vec<u8>>, Error>>

Make a request, and return an Response, as the header Parts and collect the entire collected Body as a Vec of bytes.

Implementors§