[][src]Trait limiting_factor::api::replies::ApiResponse

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

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

Required methods

fn into_json_response(self) -> ApiJsonResponse<T>

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

Loading content...

Implementations on Foreign Types

impl<T> ApiResponse<T> for Json<T>[src]

Prepares an API response from a JSON.

Loading content...

Implementors

impl<T> ApiResponse<T> for T where
    T: Serialize
[src]

Prepares an API response from a Serde-serializable result.

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

Examples

Loading content...