Trait rama::http::BodyExtractExt
pub trait BodyExtractExt: Sealed {
// Required methods
fn try_into_json<T>(
self,
) -> impl Future<Output = Result<T, OpaqueError>> + Send
where T: DeserializeOwned + Send + 'static;
fn try_into_string(
self,
) -> impl Future<Output = Result<String, OpaqueError>> + Send;
}
Expand description
An extension trait for Body
that provides methods to extract data from it.
Required Methods§
fn try_into_json<T>(self) -> impl Future<Output = Result<T, OpaqueError>> + Sendwhere
T: DeserializeOwned + Send + 'static,
fn try_into_json<T>(self) -> impl Future<Output = Result<T, OpaqueError>> + Sendwhere
T: DeserializeOwned + Send + 'static,
Try to deserialize the (contained) body as a JSON object.
fn try_into_string(
self,
) -> impl Future<Output = Result<String, OpaqueError>> + Send
fn try_into_string( self, ) -> impl Future<Output = Result<String, OpaqueError>> + Send
Try to turn the (contained) body in an utf-8 string.
Object Safety§
This trait is not object safe.