ApiResponse

Trait ApiResponse 

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

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

Required Methods§

Source

fn into_json_response(self) -> ApiJsonResponse<T>

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

Implementations on Foreign Types§

Source§

impl<T> ApiResponse<T> for Json<T>

Source§

impl<T, E> ApiResponse<T> for Result<T, E>
where T: ApiResponse<T>, E: FailureResponse,

Implementors§

Source§

impl<T> ApiResponse<T> for T
where T: Serialize,