pub struct Request { /* private fields */ }Expand description
An HTTP request with its body fully received.
A request shares the connection’s receive buffer instead of copying out of it, so creating one allocates nothing. It can be kept for as long as needed; the connection only reuses the buffer once the request has been dropped.
Implementations§
Source§impl Request
impl Request
Sourcepub fn path(&self) -> &str
pub fn path(&self) -> &str
The path part of the target, without the query string. For a target in
absolute form (http://host/path), the scheme and host are left out.
Sourcepub fn version_minor(&self) -> u8
pub fn version_minor(&self) -> u8
1 for HTTP/1.1, 0 for HTTP/1.0.
Sourcepub fn headers(&self) -> impl Iterator<Item = (&str, &[u8])>
pub fn headers(&self) -> impl Iterator<Item = (&str, &[u8])>
All header fields in the order they were sent, values trimmed.
Sourcepub fn header(&self, name: &str) -> Option<&[u8]>
pub fn header(&self, name: &str) -> Option<&[u8]>
The first value of the header name (case-insensitive).
Trait Implementations§
Auto Trait Implementations§
impl !Send for Request
impl !Sync for Request
impl Forget for Request
impl Freeze for Request
impl Move for Request
impl RefUnwindSafe for Request
impl Unpin for Request
impl UnsafeUnpin 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