pub struct HeaderFieldDecoder { /* private fields */ }
Expand description
Header field decoder.
Implementations§
Source§impl HeaderFieldDecoder
impl HeaderFieldDecoder
Sourcepub const fn new(max_length: Option<usize>) -> HeaderFieldDecoder
pub const fn new(max_length: Option<usize>) -> HeaderFieldDecoder
Create a new header field decoder.
Sourcepub fn decode(&mut self, line: Bytes) -> Result<Option<HeaderField>, Error>
pub fn decode(&mut self, line: Bytes) -> Result<Option<HeaderField>, Error>
Decode a given header line as a header field.
The header field is not returned immediately. Instead, it is buffered until the next line is received. If the next line starts with a whitespace character, it is considered a continuation of the previous header field.
The buffered header field is returned when the given line is empty or it starts with a non-whitespace character.
Auto Trait Implementations§
impl !Freeze for HeaderFieldDecoder
impl RefUnwindSafe for HeaderFieldDecoder
impl Send for HeaderFieldDecoder
impl Sync for HeaderFieldDecoder
impl Unpin for HeaderFieldDecoder
impl UnwindSafe for HeaderFieldDecoder
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