pub struct ToJson<T: ApiBody>(pub T);
Expand description

Wrap responses in this to return them as JSON

Tuple Fields§

§0: T

Trait Implementations§

This returns information about the shape of the type and description of parts of it.
The type that we should look at to work out what the response body will look like.
This describes how the type can be converted into an http::Response.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.