pub struct RequestParts {
pub method: Method,
pub uri: Uri,
pub version: Version,
pub headers: HeaderMap,
pub extensions: Extensions,
/* private fields */
}
Expand description
Component parts of an HTTP Request
The HTTP request head consists of a method, uri, version, and a set of header fields.
Fields§
§method: Method
The request’s method
uri: Uri
The request’s URI
version: Version
The request’s version
headers: HeaderMap
The request’s headers
extensions: Extensions
The request’s extensions
Trait Implementations§
Source§impl<S> FromRequestParts<S> for Parts
impl<S> FromRequestParts<S> for Parts
Source§type Rejection = Infallible
type Rejection = Infallible
If the extractor fails it’ll use this “rejection” type. A rejection is
a kind of error that can be converted into a response.
Source§async fn from_request_parts(
parts: &mut Parts,
_state: &S,
) -> Result<Parts, <Parts as FromRequestParts<S>>::Rejection>
async fn from_request_parts( parts: &mut Parts, _state: &S, ) -> Result<Parts, <Parts as FromRequestParts<S>>::Rejection>
Perform the extraction.
Source§impl RequestPartsExt for Parts
impl RequestPartsExt for Parts
Source§fn extract<E>(
&mut self,
) -> impl Future<Output = Result<E, <E as FromRequestParts<()>>::Rejection>> + Sendwhere
E: FromRequestParts<()> + 'static,
fn extract<E>(
&mut self,
) -> impl Future<Output = Result<E, <E as FromRequestParts<()>>::Rejection>> + Sendwhere
E: FromRequestParts<()> + 'static,
Apply an extractor to this
Parts
. Read moreSource§fn extract_with_state<'a, E, S>(
&'a mut self,
state: &'a S,
) -> impl Future<Output = Result<E, <E as FromRequestParts<S>>::Rejection>> + Send + 'a
fn extract_with_state<'a, E, S>( &'a mut self, state: &'a S, ) -> impl Future<Output = Result<E, <E as FromRequestParts<S>>::Rejection>> + Send + 'a
Apply an extractor that requires some state to this
Parts
. Read moreAuto Trait Implementations§
impl !Freeze for Parts
impl !RefUnwindSafe for Parts
impl Send for Parts
impl Sync for Parts
impl Unpin for Parts
impl !UnwindSafe for Parts
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<S, T> FromRequest<S, ViaParts> for T
impl<S, T> FromRequest<S, ViaParts> for T
Source§type Rejection = <T as FromRequestParts<S>>::Rejection
type Rejection = <T as FromRequestParts<S>>::Rejection
If the extractor fails it’ll use this “rejection” type. A rejection is
a kind of error that can be converted into a response.
Source§async fn from_request(
req: Request<Body>,
state: &S,
) -> Result<T, <T as FromRequest<S, ViaParts>>::Rejection>
async fn from_request( req: Request<Body>, state: &S, ) -> Result<T, <T as FromRequest<S, ViaParts>>::Rejection>
Perform the extraction.