pub trait HandlerResponse {
    type ResponseBody: ApiBody;

    fn handler_response<'async_trait>(
        self
    ) -> Pin<Box<dyn Future<Output = Result<Response<Vec<u8>>, ApiError>> + Send + 'async_trait>>
    where
        Self: 'async_trait
; }
Expand description

Anything that you’d like to be able to return from a handler function must implement this trait, which decides how to take the result of a handler function and encode it into an http::Response<Vec<u8>>, or failing to do so, returns an ApiError.

Required Associated Types§

The type that we should look at to work out what the response body will look like.

Required Methods§

This describes how the type can be converted into an http::Response.

Implementations on Foreign Types§

Implementors§