pub struct Header { /* private fields */ }Expand description
A HTTP header
Implementations
sourceimpl 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 an IoLimiter<T> to limit the amount of data
that will be read.
Trait Implementations
sourceimpl Ord for Header
impl Ord for Header
1.21.0 · sourcefn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Self
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Self where
Self: PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Self where
Self: PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl PartialOrd<Header> for Header
impl PartialOrd<Header> for Header
sourcefn partial_cmp(&self, other: &Header) -> Option<Ordering>
fn partial_cmp(&self, other: &Header) -> Option<Ordering>
This method returns an ordering between self and other values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · sourcefn 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 more
impl 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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more