Crates.io | limit-reader |
lib.rs | limit-reader |
version | 0.1.4 |
source | src |
created_at | 2024-06-05 12:20:13.337248 |
updated_at | 2024-06-28 11:20:22.244051 |
description | A simple reader that limits the number of bytes read from an underlying reader. |
homepage | |
repository | https://github.com/fzdwx/limit-reader |
max_upload_size | |
id | 1262705 |
size | 52,653 |
A simple reader that limits the number of bytes read from an underlying reader.
cargo add limit-reader
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();
}