slice-of-bytes-reader

Crates.ioslice-of-bytes-reader
lib.rsslice-of-bytes-reader
version0.1.0
created_at2025-11-05 10:24:40.356421+00
updated_at2025-11-05 10:24:40.356421+00
descriptionTurns an iterator of `AsRef<[u8]>` into a reader implements `std::io::Read`
homepage
repositoryhttps://github.com/EAimTY/slice-of-bytes-reader
max_upload_size
id1917776
size5,867
(EAimTY)

documentation

README

slice-of-bytes-reader

Turns an iterator of AsRef<[u8]> into a reader implements std::io::Read.

Version Documentation License

Usage

let chunks: &[&[u8]] = &[
    b"", b"ab", b"", b"c", b"defg", b"", b"hij", b"klmnop", b"qrstuvw", b"", b"", b"xyz",
    b"", b"",
];

let mut reader = Reader::new(chunks.into_iter());
let mut result = String::new();
let total_length = reader.read_to_string(&mut result).unwrap();

assert_eq!(result, "abcdefghijklmnopqrstuvwxyz");
assert_eq!(total_length, 26);
Commit count: 0

cargo fmt