pub struct Request {
pub method: SlicePos,
pub path: SlicePos,
pub version: u8,
}Expand description
A parsed Request.
§Example
let buf = b"GET /404 HTTP/1.1\r\nHost:";
let mut req = ntex_httparse::Request::default();
if let Ok(ntex_httparse::Status::Complete(consumed)) = req.parse(buf) {
// check router for path.
// /404 doesn't exist? we could stop parsing
let _ = req.path;
}Fields§
§method: SlicePosParsed request’s method.
path: SlicePosParsed request’s path.
version: u8Parsed request’s http version.
Implementations§
Trait Implementations§
impl Copy for Request
impl Eq for Request
impl StructuralPartialEq for Request
Auto Trait Implementations§
impl Freeze for Request
impl RefUnwindSafe for Request
impl Send for Request
impl Sync 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