Skip to main content

buffer_bytes

Function buffer_bytes 

Source
pub fn buffer_bytes<'b, S, E>(
    stream: S,
    size: usize,
) -> impl Stream<Item = Result<Bytes, E>> + Send + 'b
where S: Stream<Item = Result<Bytes, E>> + Send + 'b, E: Send + 'b,
Expand description

Coalesce output into chunks of at least size bytes.

The final chunk is whatever is left over, and may be shorter.