pub trait GenericBodyExt {
// Required methods
fn from_string(s: String) -> Self;
fn from_value(value: &Value) -> Self;
fn empty() -> Self;
fn build_response(
status_code: StatusCode,
payload: String,
headers: Option<HeaderMap>,
) -> Response<GenericBody>;
fn into_response(
self,
status_code: StatusCode,
headers: Option<HeaderMap>,
) -> Response<GenericBody>;
fn into_json_response(
self,
status_code: StatusCode,
headers: Option<HeaderMap>,
) -> Response<GenericBody>;
fn create_404_response() -> Response<GenericBody>;
fn create_405_response(
method: &Method,
allowed_methods: &[Method],
) -> Response<GenericBody>;
}Required Methods§
fn from_string(s: String) -> Self
fn from_value(value: &Value) -> Self
fn empty() -> Self
fn build_response( status_code: StatusCode, payload: String, headers: Option<HeaderMap>, ) -> Response<GenericBody>
fn into_response( self, status_code: StatusCode, headers: Option<HeaderMap>, ) -> Response<GenericBody>
fn into_json_response( self, status_code: StatusCode, headers: Option<HeaderMap>, ) -> Response<GenericBody>
fn create_404_response() -> Response<GenericBody>
fn create_405_response( method: &Method, allowed_methods: &[Method], ) -> Response<GenericBody>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.