pub struct ChunkedDecoder { /* private fields */ }Expand description
Sans-IO chunked transfer-encoding decoder.
Feed wire bytes via decode. Decoded body bytes are written
into the output buffer. Returns how many input bytes were consumed
and how many output bytes were produced.
§Usage
ⓘ
let mut decoder = ChunkedDecoder::new();
let (consumed, produced) = decoder.decode(wire_bytes, &mut output_buf)?;Implementations§
Source§impl ChunkedDecoder
impl ChunkedDecoder
Sourcepub fn total_decoded(&self) -> usize
pub fn total_decoded(&self) -> usize
Total decoded body bytes produced so far.
Sourcepub fn decode(
&mut self,
input: &[u8],
output: &mut [u8],
) -> Result<(usize, usize), HttpError>
pub fn decode( &mut self, input: &[u8], output: &mut [u8], ) -> Result<(usize, usize), HttpError>
Decode chunked wire bytes into body bytes.
Returns (consumed, produced) — how many input bytes were consumed
and how many output bytes were written.
Call repeatedly as more wire bytes arrive. When is_done() returns
true, the body is complete.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ChunkedDecoder
impl RefUnwindSafe for ChunkedDecoder
impl Send for ChunkedDecoder
impl Sync for ChunkedDecoder
impl Unpin for ChunkedDecoder
impl UnsafeUnpin for ChunkedDecoder
impl UnwindSafe for ChunkedDecoder
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