pub struct Request<'a, const HEADER_SIZE_MAX: usize = 4096> {
pub header: Data,
pub method: Data,
pub target: Data,
pub version: Data,
pub fields: Vec<(Data, Data)>,
pub stream: &'a mut Source,
}Expand description
A HTTP request
Fields§
§header: DataThe raw header bytes
method: DataThe method part within the request line
target: DataThe target part within the request line
version: DataThe version part within the request line
fields: Vec<(Data, Data)>The key/value fields within the header
stream: &'a mut SourceThe connection stream
Implementations§
Source§impl<'a, const HEADER_SIZE_MAX: usize> Request<'a, HEADER_SIZE_MAX>
impl<'a, const HEADER_SIZE_MAX: usize> Request<'a, HEADER_SIZE_MAX>
Sourcepub fn target_path(&self) -> Option<&Path>
pub fn target_path(&self) -> Option<&Path>
Gets the request target as path
§Important
On non-unix platforms, this function uses a str as intermediate representation, so the path must be valid
UTF-8. If this might be a problem, you should use the raw target field directly.
Sourcepub fn field<N>(&self, name: N) -> Option<&Data>
pub fn field<N>(&self, name: N) -> Option<&Data>
Gets the field with the given name (performs an ASCII-case-insensitve comparison)
Trait Implementations§
Auto Trait Implementations§
impl<'a, const HEADER_SIZE_MAX: usize> Freeze for Request<'a, HEADER_SIZE_MAX>
impl<'a, const HEADER_SIZE_MAX: usize = 4096> !RefUnwindSafe for Request<'a, HEADER_SIZE_MAX>
impl<'a, const HEADER_SIZE_MAX: usize> Send for Request<'a, HEADER_SIZE_MAX>
impl<'a, const HEADER_SIZE_MAX: usize> Sync for Request<'a, HEADER_SIZE_MAX>
impl<'a, const HEADER_SIZE_MAX: usize> Unpin for Request<'a, HEADER_SIZE_MAX>
impl<'a, const HEADER_SIZE_MAX: usize> UnsafeUnpin for Request<'a, HEADER_SIZE_MAX>
impl<'a, const HEADER_SIZE_MAX: usize = 4096> !UnwindSafe for Request<'a, HEADER_SIZE_MAX>
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