slice-of-bytes-reader 0.1.0

Turns an iterator of `AsRef<[u8]>` into a reader implements `std::io::Read`
Documentation
  • Coverage
  • 33.33%
    1 out of 3 items documented0 out of 2 items with examples
  • Size
  • Source code size: 5.38 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.41 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 12s Average build duration of successful builds.
  • all releases: 12s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • EAimTY/slice-of-bytes-reader
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • EAimTY

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);