pub fn stream<S, B, E>(stream: S) -> impl Replywhere S: Stream<Item = Result<B, E>> + Send + Sync + 'static, B: Into<Bytes>, E: Into<Box<dyn Error + Send + Sync>> + Send + 'static,
Converts a Stream of data chunks into a reply.
Stream
use warp::Filter; use futures_util::stream; use bytes::Bytes; let route = warp::any().map(|| { let chunks = vec![Ok::<_, std::io::Error>(Bytes::from("hello"))]; warp::reply::stream(stream::iter(chunks)) });