Trait limiting_factor::api::replies::ApiResponse
source · 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
sourcefn into_json_response(self) -> ApiJsonResponse<T>
fn into_json_response(self) -> ApiJsonResponse<T>
Consumes the value and creates a JSON or a Status result response.
Implementations on Foreign Types
sourceimpl<T> ApiResponse<T> for Json<T>
impl<T> ApiResponse<T> for Json<T>
Prepares an API response from a JSON.
fn into_json_response(self) -> ApiJsonResponse<T>
Implementors
impl<T> ApiResponse<T> for Twhere
T: Serialize,
Prepares an API response from a Serde-serializable result.
This is probably the easiest way to convert most struct into API responders.