pub struct ToJson<T: ApiBody>(pub T);
Expand description
Wrap responses in this to return them as JSON
Tuple Fields§
§0: T
Trait Implementations§
source§impl<T> ApiBody for ToJson<T>where
T: ApiBody,
impl<T> ApiBody for ToJson<T>where
T: ApiBody,
source§fn api_body_info() -> ApiBodyInfo
fn api_body_info() -> ApiBodyInfo
This returns information about the shape of the type and description of parts of it.
source§impl<T: ApiBody + Serialize + Send> HandlerResponse for ToJson<T>
impl<T: ApiBody + Serialize + Send> HandlerResponse for ToJson<T>
§type ResponseBody = T
type ResponseBody = T
The type that we should look at to work out what the response body will look like.