pub trait ApiResponse<T> {
    fn into_json_response(self) -> ApiJsonResponse<T>;
}
Expand description

This trait allows to consume an object into an HTTP response.

Required Methods

Consumes the value and creates a JSON or a Status result response.

Implementations on Foreign Types

Prepares an API response from a JSON.

Implementors

Prepares an API response from a Serde-serializable result.

This is probably the easiest way to convert most struct into API responders.

Examples