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 a specific 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 set_path(&mut self, path: String)
pub fn set_path(&mut self, path: String)
Set the request path.
This is used internally for mounted sub-applications, where the mount prefix is stripped from the path before forwarding.
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.
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).