Skip to main content

stream

Function stream 

Source
pub fn stream<S>(s: S) -> Body
where S: TryStream<Ok = Bytes, Error = Error> + Send + Sync + 'static,
Expand description

Creates a streaming body from an async byte stream.

Replaces hyper::Body::wrap_stream(s).

The stream must yield Result<Bytes, io::Error>. Each successful item is wrapped as an HTTP data Frame before being fed into the body.