Skip to main content

encode_stream

Function encode_stream 

Source
pub fn encode_stream<S>(s: S, enc: Encoding) -> ByteStream
where S: Stream<Item = Result<Bytes>> + Send + 'static,
Expand description

Re-encode a plaintext byte stream with enc, flushing after every input chunk so output is emitted promptly (never buffered until end of stream). Identity/Unknown pass through unchanged. Uses fast compression levels (high quality costs ms per call and buys almost nothing on tiny flushed payloads).