pub struct Request<T> { /* private fields */ }
Expand description
Represents an HTTP request.
This struct holds the HTTP method, version, URL, headers, and body of the request. The body is generic, allowing flexibility in request content.
Implementations§
source§impl<T> Request<T>
impl<T> Request<T>
sourcepub fn from_parts(parts: Parts, body: T) -> Self
pub fn from_parts(parts: Parts, body: T) -> Self
Creates a request from the given parts and body.
sourcepub fn method_mut(&mut self) -> &mut Method
pub fn method_mut(&mut self) -> &mut Method
Returns a mutable reference to the HTTP method of the request.
sourcepub fn version_mut(&mut self) -> &mut Version
pub fn version_mut(&mut self) -> &mut Version
Returns a mutable reference to the HTTP version of the request.
sourcepub fn headers_mut(&mut self) -> &mut Headers
pub fn headers_mut(&mut self) -> &mut Headers
Returns a mutable reference to the headers of the request.
sourcepub fn extensions(&self) -> &Extensions
pub fn extensions(&self) -> &Extensions
Returns this request extensions.
sourcepub fn extensions_mut(&mut self) -> &mut Extensions
pub fn extensions_mut(&mut self) -> &mut Extensions
Returns a mutable reference to the request extensions.
sourcepub fn into_parts(self) -> (T, Parts)
pub fn into_parts(self) -> (T, Parts)
Split this request into its body and rest of the parts.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Request<T>where
T: Freeze,
impl<T> !RefUnwindSafe for Request<T>
impl<T> Send for Request<T>where
T: Send,
impl<T> Sync for Request<T>where
T: Sync,
impl<T> Unpin for Request<T>where
T: Unpin,
impl<T> !UnwindSafe for Request<T>
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