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

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

#14 in #file-read

49 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