Trait api::Api [] [src]

pub trait Api {
    type Reply;
    type Body: Read;
    type Error;
    fn method(&self) -> Method;
    fn path(&self) -> String;
    fn query(&self) -> Query;
    fn headers(&self) -> Headers;
    fn body(&self) -> Self::Body;
    fn parse<Resp>(&self, _: &mut Resp) -> Result<Self::Reply, Self::Error>
    where
        Resp: HttpResponse
; }

Api represents a HTTP API exposing all the request parameters and a function to parse the HTTP response.

Associated Types

Required Methods

Return the HTTP method used by this API.

Return the URL path for this API request.

Return the URL query for this API request.

Return the headers for this HTTP request.

Return the body of this HTTP request. If the request doesn't expect any body (i.e. GET), it should return std::io::Empty.

Parse the HTTP response, received from the actual client, into the type Reply.

Implementors