pub struct TypedBody<BodyType: JsonSchema + DeserializeOwned + Send + Sync> { /* private fields */ }
Expand description
TypedBody<BodyType>
is an extractor used to deserialize an instance of
BodyType
from an HTTP request body. BodyType
is any structure of yours
that implements serde::Deserialize
. See this module’s documentation for
more information.
Implementations§
source§impl<BodyType: JsonSchema + DeserializeOwned + Send + Sync> TypedBody<BodyType>
impl<BodyType: JsonSchema + DeserializeOwned + Send + Sync> TypedBody<BodyType>
pub fn into_inner(self) -> BodyType
Trait Implementations§
source§impl<BodyType: Debug + JsonSchema + DeserializeOwned + Send + Sync> Debug for TypedBody<BodyType>
impl<BodyType: Debug + JsonSchema + DeserializeOwned + Send + Sync> Debug for TypedBody<BodyType>
source§impl<BodyType> ExclusiveExtractor for TypedBody<BodyType>
impl<BodyType> ExclusiveExtractor for TypedBody<BodyType>
source§fn from_request<'life0, 'async_trait, Context>(
rqctx: &'life0 RequestContext<Context>,
request: Request<Body>
) -> Pin<Box<dyn Future<Output = Result<TypedBody<BodyType>, HttpError>> + Send + 'async_trait>>where
Context: 'async_trait + ServerContext,
'life0: 'async_trait,
fn from_request<'life0, 'async_trait, Context>(
rqctx: &'life0 RequestContext<Context>,
request: Request<Body>
) -> Pin<Box<dyn Future<Output = Result<TypedBody<BodyType>, HttpError>> + Send + 'async_trait>>where
Context: 'async_trait + ServerContext,
'life0: 'async_trait,
Construct an instance of this type from a
RequestContext
.fn metadata(content_type: ApiEndpointBodyContentType) -> ExtractorMetadata
Auto Trait Implementations§
impl<BodyType> Freeze for TypedBody<BodyType>where
BodyType: Freeze,
impl<BodyType> RefUnwindSafe for TypedBody<BodyType>where
BodyType: RefUnwindSafe,
impl<BodyType> Send for TypedBody<BodyType>
impl<BodyType> Sync for TypedBody<BodyType>
impl<BodyType> Unpin for TypedBody<BodyType>where
BodyType: Unpin,
impl<BodyType> UnwindSafe for TypedBody<BodyType>where
BodyType: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more