#[non_exhaustive]pub struct HttpRequest {
pub method: HttpMethod,
pub route: String,
pub version: HttpVersion,
pub headers: Vec<HttpHeader>,
pub len: u64,
pub addr: IpAddr,
}Expand description
Request from client to handle
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.method: HttpMethod§route: String§version: HttpVersion§headers: Vec<HttpHeader>§len: u64Contents of the Content-Length header
addr: IpAddrIP address of this request (0.0.0.0 if none)
Implementations§
Source§impl HttpRequest
impl HttpRequest
Sourcepub fn get_header<'a>(&'a self, name: &str) -> Option<&'a str>
pub fn get_header<'a>(&'a self, name: &str) -> Option<&'a str>
Retrieves a header value, if any
Sourcepub fn has_header(&self, name: &str) -> bool
pub fn has_header(&self, name: &str) -> bool
Checks if this header exists
Sourcepub fn cmp_header(&self, name: &str, value: &str) -> bool
pub fn cmp_header(&self, name: &str, value: &str) -> bool
Compares equality of header values
Trait Implementations§
Source§impl Clone for HttpRequest
impl Clone for HttpRequest
Source§fn clone(&self) -> HttpRequest
fn clone(&self) -> HttpRequest
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for HttpRequest
impl Debug for HttpRequest
Source§impl Default for HttpRequest
impl Default for HttpRequest
Source§fn default() -> HttpRequest
fn default() -> HttpRequest
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for HttpRequest
impl RefUnwindSafe for HttpRequest
impl Send for HttpRequest
impl Sync for HttpRequest
impl Unpin for HttpRequest
impl UnwindSafe for HttpRequest
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