pub struct ChunkedEncoder { /* private fields */ }Expand description
Encoder for chunked transfer encoding.
Implementations§
Source§impl ChunkedEncoder
impl ChunkedEncoder
Sourcepub fn encode_chunk(data: &[u8]) -> BytesMut
pub fn encode_chunk(data: &[u8]) -> BytesMut
Encodes a data chunk into the chunked format.
Sourcepub fn encode_final(&mut self, trailers: Option<&HeaderMap>) -> BytesMut
pub fn encode_final(&mut self, trailers: Option<&HeaderMap>) -> BytesMut
Encodes the final chunk (zero-length) with optional trailers.
Sourcepub fn encode_frame<B: Buf>(&mut self, frame: Frame<B>, dst: &mut BytesMut)
pub fn encode_frame<B: Buf>(&mut self, frame: Frame<B>, dst: &mut BytesMut)
Encodes a body frame into chunked format.
Sourcepub fn finalize(&mut self, trailers: Option<&HeaderMap>, dst: &mut BytesMut)
pub fn finalize(&mut self, trailers: Option<&HeaderMap>, dst: &mut BytesMut)
Writes the final chunk if not already finished.
Sourcepub fn is_finished(&self) -> bool
pub fn is_finished(&self) -> bool
Returns true if the final chunk has been encoded.
Trait Implementations§
Source§impl Debug for ChunkedEncoder
impl Debug for ChunkedEncoder
Source§impl Default for ChunkedEncoder
impl Default for ChunkedEncoder
Source§fn default() -> ChunkedEncoder
fn default() -> ChunkedEncoder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ChunkedEncoder
impl RefUnwindSafe for ChunkedEncoder
impl Send for ChunkedEncoder
impl Sync for ChunkedEncoder
impl Unpin for ChunkedEncoder
impl UnsafeUnpin for ChunkedEncoder
impl UnwindSafe for ChunkedEncoder
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, _span: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Instruments this future with a span (no-op when disabled).
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
Instruments this future with the current span (no-op when disabled).