limit-reader 0.1.4

A simple reader that limits the number of bytes read from an underlying reader.
Documentation
  • Coverage
  • 0%
    0 out of 1 items documented0 out of 0 items with examples
  • Size
  • Source code size: 52.34 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.03 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 9s Average build duration of successful builds.
  • all releases: 9s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • fzdwx/limit-reader
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • fzdwx

Limit Reader

A simple reader that limits the number of bytes read from an underlying reader.

Install

cargo add limit-reader

Usage

fn foo() {
    let hello_txt = fs::File::open("file").unwrap();
    let mut reader = LimiterReader::new(hello_txt, 1024 * 1024);
    let mut r1 = vec![0u8];
    reader.read_to_end(&mut r1).unwrap();
}