pub struct Header { /* private fields */ }Expand description
A HTTP header
Implementations§
source§impl Header
impl Header
sourcepub const fn new(start_line: HeaderStartLine, fields: HeaderFields) -> Self
pub const fn new(start_line: HeaderStartLine, fields: HeaderFields) -> Self
Creates a new HTTP/1.1 header
sourcepub fn start_line(&self) -> &HeaderStartLine
pub fn start_line(&self) -> &HeaderStartLine
The start line
sourcepub fn start_line_mut(&mut self) -> &mut HeaderStartLine
pub fn start_line_mut(&mut self) -> &mut HeaderStartLine
The start line
sourcepub fn fields(&self) -> &HeaderFields
pub fn fields(&self) -> &HeaderFields
The header fields
sourcepub fn fields_mut(&mut self) -> &mut HeaderFields
pub fn fields_mut(&mut self) -> &mut HeaderFields
The header fields
sourcepub fn read<T>(source: &mut T) -> Result<Self, Error>where
T: BufRead,
pub fn read<T>(source: &mut T) -> Result<Self, Error>where
T: BufRead,
Loads a HTTP header from bytes and returns the remaining bytes
Warning:
This function will read forever until there is either a \r\n\r\n or an EOF. To prevent DOS-attacks, it is
strongly recommended to wrap the source into a std::io::Take to limit the amount of data that will be read.
Trait Implementations§
source§impl Ord for Header
impl Ord for Header
source§impl PartialEq for Header
impl PartialEq for Header
source§impl PartialOrd for Header
impl PartialOrd for Header
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read moreimpl Eq for Header
impl StructuralEq for Header
impl StructuralPartialEq for Header
Auto Trait Implementations§
impl RefUnwindSafe for Header
impl Send for Header
impl Sync for Header
impl Unpin for Header
impl UnwindSafe for Header
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