You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
512 B
Rust
18 lines
512 B
Rust
use tokio_util::io::{ReaderStream, StreamReader};
|
|
|
|
use crate::{adapted_iter::AdaptedFilesIterBox, adapters::*, to_io_err};
|
|
use async_stream::stream;
|
|
|
|
pub fn concat_read_streams(input: AdaptedFilesIterBox) -> ReadBox {
|
|
let s = stream! {
|
|
for await output in input {
|
|
let o = output.map_err(to_io_err)?.inp;
|
|
let stream = ReaderStream::new(o);
|
|
for await bytes in stream {
|
|
yield bytes;
|
|
}
|
|
}
|
|
};
|
|
Box::pin(StreamReader::new(s))
|
|
}
|