pub struct Request { /* private fields */ }
Expand description
Struct containing data on a single request.
parsed_body which is a Option
body is used when the body of the request is not a String
Implementations§
Source§impl Request
impl Request
pub fn new( body: Vec<u8>, raw_headers: HashMap<String, String>, status_line: Vec<String>, wildcard: Option<String>, ) -> Request
Sourcepub fn get_raw_body(&self) -> &[u8] ⓘ
pub fn get_raw_body(&self) -> &[u8] ⓘ
Get request body as bytes
Sourcepub fn get_parsed_body(&self) -> Option<&str>
pub fn get_parsed_body(&self) -> Option<&str>
Get request body as a string
Sourcepub fn get_headers(&self) -> &HashMap<String, String>
pub fn get_headers(&self) -> &HashMap<String, String>
Get request headers in a HashMap
Sourcepub fn get_status_line(&self) -> &[String]
pub fn get_status_line(&self) -> &[String]
Get status line of request
pub fn get_wildcard(&self) -> Option<&String>
pub fn get_http2(&self) -> bool
pub fn set_http2(self, w: bool) -> Self
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