pub struct RawBody<B = Body>(pub B);
Expand description
Extractor that extracts the raw request body.
Note that body::Body
can be extracted directly. This purpose of this
type is to extract other types of request bodies.
Example
use axum::{
extract::RawBody,
routing::get,
Router,
};
use futures::StreamExt;
async fn handler(RawBody(body): RawBody) {
// ...
}
let app = Router::new().route("/users", get(handler));
Tuple Fields
0: B
Trait Implementations
type Rejection = BodyAlreadyExtracted
type Rejection = BodyAlreadyExtracted
If the extractor fails it’ll use this “rejection” type. A rejection is a kind of error that can be converted into a response. Read more
fn from_request<'life0, 'async_trait>(
req: &'life0 mut RequestParts<B>
) -> Pin<Box<dyn Future<Output = Result<Self, Self::Rejection>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn from_request<'life0, 'async_trait>(
req: &'life0 mut RequestParts<B>
) -> Pin<Box<dyn Future<Output = Result<Self, Self::Rejection>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Perform the extraction.
Auto Trait Implementations
impl<B> RefUnwindSafe for RawBody<B> where
B: RefUnwindSafe,
impl<B> UnwindSafe for RawBody<B> where
B: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
Create a new Policy
that returns Action::Follow
only if self
and other
return
Action::Follow
. Read more
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more