#byte #file-read #io-read #progress #file-io #wrapper #how

read-progress

A rust library wrapping a Read in something that records how many bytes have been read

5 releases (breaking)

Uses old Rust 2015

0.5.0 Jul 25, 2023
0.4.0 Jul 25, 2023
0.3.0 Mar 31, 2023
0.2.0 Jan 21, 2020
0.1.0 Jan 2, 2020

#9 in #file-read

Download history 3/week @ 2024-07-08 1/week @ 2024-07-15 2/week @ 2024-07-22 6/week @ 2024-08-05 15/week @ 2024-08-26 7/week @ 2024-09-09 8/week @ 2024-09-16 39/week @ 2024-09-23 24/week @ 2024-09-30

78 downloads per month
Used in 3 crates

MIT OR Apache-2.0 OR AGPL-3.0+

11KB
165 lines

read-progress

This std::io::Read wrapper allows you to answer: “How much of this file has been read?”

Monitor how much you have read from a Read.

Usage

use read_progress::ReaderWithSize;
let mut rdr = ReaderWithSize::from_file(file)?;
// ...
// ... [ perform regular reads ]
rdr.fraction()         // 0 (nothing) → 1 (everything) with how much of the file has been read

// Based on how fast the file is being read you can call:
rdr.eta()              // `std::time::Duration` with how long until it's finished
rdr.est_total_time()   // `std::time::Instant` when, at this rate, it'll be finished

Available under the MIT, or Apache-2.0 or GNU Affero GPL 3.0+.


lib.rs:

This std::io::Read wrapper allows you to answer: “How much of this file has been read?”

Monitor how much you have read from a Read.

Usage

use read_progress::ReaderWithSize;
let mut rdr = ReaderWithSize::from_file(file)?;
// ...
// ... [ perform regular reads ]
rdr.fraction()         // 0 (nothing) → 1 (everything) with how much of the file has been read

// Based on how fast the file is being read you can call:
rdr.eta()              // `std::time::Duration` with how long until it's finished
rdr.est_total_time()   // `std::time::Instant` when, at this rate, it'll be finished

No runtime deps