[][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

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

Implementations on Foreign Types

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

Prepares an API response from a JSON.

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