pub struct Request { /* private fields */ }Expand description
HTTP request.
Implementations§
Source§impl Request
impl Request
Sourcepub fn with_version(
method: Method,
path: impl Into<String>,
version: HttpVersion,
) -> Self
pub fn with_version( method: Method, path: impl Into<String>, version: HttpVersion, ) -> Self
Create a new request with an explicit HTTP version.
Sourcepub fn version(&self) -> HttpVersion
pub fn version(&self) -> HttpVersion
Get the HTTP version.
Sourcepub fn set_version(&mut self, version: HttpVersion)
pub fn set_version(&mut self, version: HttpVersion)
Set the HTTP version.
Sourcepub fn headers_mut(&mut self) -> &mut Headers
pub fn headers_mut(&mut self) -> &mut Headers
Get mutable headers.
Sourcepub fn insert_extension<T: Any + Send + Sync>(&mut self, value: T)
pub fn insert_extension<T: Any + Send + Sync>(&mut self, value: T)
Insert a typed extension value.
Sourcepub fn get_extension_mut<T: Any + Send + Sync>(&mut self) -> Option<&mut T>
pub fn get_extension_mut<T: Any + Send + Sync>(&mut self) -> Option<&mut T>
Get a mutable typed extension value.
Sourcepub fn take_extension<T: Any + Send + Sync>(&mut self) -> Option<T>
pub fn take_extension<T: Any + Send + Sync>(&mut self) -> Option<T>
Remove and return a typed extension value.
Sourcepub fn background_tasks(&mut self) -> &BackgroundTasks
pub fn background_tasks(&mut self) -> &BackgroundTasks
Access (and lazily create) the request-scoped background tasks container.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Request
impl !RefUnwindSafe for Request
impl Send for Request
impl Sync for Request
impl Unpin for Request
impl !UnwindSafe for Request
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, _span: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Instruments this future with a span (no-op when disabled).
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
Instruments this future with the current span (no-op when disabled).