Skip to main content

encode_stream

Function encode_stream 

Source
pub fn encode_stream<'b, S, T, ENC>(
    stream: S,
    encoder: ENC,
) -> impl Stream<Item = Result<Bytes, StreamError>> + Send + 'b
where S: Stream<Item = Result<T, StreamError>> + Send + Unpin + 'b, T: Send + 'b, ENC: ItemEncoder<T> + Send + 'b,
Expand description

Encode a stream of items into a stream of body chunks.

Empty chunks are swallowed rather than yielded, so a format with no prologue or epilogue does not emit zero-length frames.