Struct tinyhttp_internal::request::Request
source · 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( raw_body: &[u8], raw_headers: Vec<String>, status_line: Vec<String>, wildcard: Option<String> ) -> Request
sourcepub fn get_raw_body(&self) -> &Vec<u8>
pub fn get_raw_body(&self) -> &Vec<u8>
Get request body as bytes
sourcepub fn get_parsed_body(&self) -> Option<String>
pub fn get_parsed_body(&self) -> Option<String>
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) -> &Vec<String>
pub fn get_status_line(&self) -> &Vec<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 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