Trait seamless::handler::response::HandlerResponse
source · 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§
sourcetype ResponseBody: ApiBody
type ResponseBody: ApiBody
The type that we should look at to work out what the response body will look like.