pub struct PayloadDecoder { /* private fields */ }Expand description
Incremental decoder for an HTTP/1 message body.
The decoder handles fixed Content-Length, chunked transfer coding, and
bodies delimited by connection EOF. It implements Decoder and retains
framing state between calls.
Fixed-length and chunked decoders emit PayloadItem::Eof when their wire
framing completes. An EOF-delimited decoder emits every available byte as a
chunk but cannot infer completion from an empty input buffer; the transport
owner must treat connection closure as the end of that payload.
Ok(None) means that more bytes or transport EOF are required. A
DecodeError reports malformed payload framing, such as an invalid
chunk-size or chunk terminator. Cloning preserves the current payload
framing state.
Chunk extensions are validated and skipped. Trailer fields are buffered
until the trailer section is complete and emitted as
PayloadItem::Trailers. A chunked payload is rejected with
DecodeError::InvalidInput if its chunk extensions exceed 16 KiB in
total, or if its trailer section, including line terminators, exceeds
4 KiB.
Trait Implementations§
Source§impl Clone for PayloadDecoder
impl Clone for PayloadDecoder
Source§fn clone(&self) -> PayloadDecoder
fn clone(&self) -> PayloadDecoder
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PayloadDecoder
impl Debug for PayloadDecoder
Source§impl Decoder for PayloadDecoder
impl Decoder for PayloadDecoder
impl Eq for PayloadDecoder
Source§impl PartialEq for PayloadDecoder
impl PartialEq for PayloadDecoder
impl StructuralPartialEq for PayloadDecoder
Auto Trait Implementations§
impl !Freeze for PayloadDecoder
impl !RefUnwindSafe for PayloadDecoder
impl !Sync for PayloadDecoder
impl Send for PayloadDecoder
impl Unpin for PayloadDecoder
impl UnsafeUnpin for PayloadDecoder
impl UnwindSafe for PayloadDecoder
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.