pub trait IntoHttpResponse {
// Required method
fn into_http_response(self) -> Response;
}Expand description
Convenience trait that allows returning Result<T, FraiseQLError> from axum
handlers by converting it directly into an HTTP Response.
Import this trait and call .into_http_response() on any
Result<impl IntoResponse, FraiseQLError> value.
Required Methods§
Sourcefn into_http_response(self) -> Response
fn into_http_response(self) -> Response
Convert this result into an axum Response.
On success the inner value is serialised via its own IntoResponse
implementation. On error the FraiseQLError is converted to a JSON
error body with the appropriate HTTP status code.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".