[][src]Trait dropshot::HttpResponse

pub trait HttpResponse {
    fn to_result(self) -> Result<Response<Body>, HttpError>;
fn metadata() -> ApiEndpointResponse; }

HttpResponse must produce a Result<Response<Body>, HttpError> and generate the response metadata. Typically one should use Response<Body> or an implementation of HttpTypedResponse.

Required methods

fn to_result(self) -> Result<Response<Body>, HttpError>

Generate the response to the HTTP call.

fn metadata() -> ApiEndpointResponse

Extract status code and structure metadata for the non-error response. Type information for errors is handled generically across all endpoints.

Loading content...

Implementations on Foreign Types

impl HttpResponse for Response<Body>[src]

Response<Body> is used for free-form responses. The implementation of to_result() is trivial, and we don't have any typed metadata to return.

Loading content...

Implementors

impl<T> HttpResponse for T where
    T: HttpTypedResponse, 
[src]

Provide results and metadata generation for all implementing types.

Loading content...