I am reading n multiple files (n chosen at runtime) in parallel, and thus I have a Vec<std::io::BufReader> with n elements.
I would like to iterate over all files in parallel, ie. obtaining an iterator on a Vec<Byte> (Byte == u8).
For example if I am reading a first stream containing “fool” and a second stream containing “bar”, I would like that my Iterator next method returns in sequence:
Some(vec!['f', 'b'])
Some(vec!['o', 'a'])
Some(vec!['o', 'r'])
None
I am not sure how to do that, do you have a suggestion?
That’s a good question. I would like that next() on the final iterator returns None as soon as at least one input returns None. I have edited the initial question to make it more clear. Thanks.