Skip to main content

ReadWithSize

Trait ReadWithSize 

Source
pub trait ReadWithSize: Read {
    // Required methods
    fn total_read(&self) -> usize;
    fn assummed_total_size(&self) -> usize;
    fn fraction(&self) -> f64;
    fn read_start_time(&self) -> Option<Instant>;

    // Provided methods
    fn eta(&self) -> Option<Duration> { ... }
    fn etc(&self) -> Option<Instant> { ... }
    fn est_total_time(&self) -> Option<Duration> { ... }
    fn bytes_per_sec(&self) -> Option<f64> { ... }
}

Required Methods§

Source

fn total_read(&self) -> usize

The total number of bytes that have been read from this reader

Source

fn assummed_total_size(&self) -> usize

The assumed total number of bytes in this reader, created when this object was created.

Source

fn fraction(&self) -> f64

How far along this reader have we read? What fraction have we read? May be >1.0 if the initial provided assumed total size was wrong.

Source

fn read_start_time(&self) -> Option<Instant>

When did this reader start reading None if it hasn’t started

Provided Methods§

Source

fn eta(&self) -> Option<Duration>

Estimated Time to Arrival, at this rate, what’s the predicted end time None if it hasn’t started yet

Source

fn etc(&self) -> Option<Instant>

Estimated Time to Completion, at this rate, how long before it is complete None if it hasn’t started yet

Source

fn est_total_time(&self) -> Option<Duration>

Total estimated duration this reader will run for. None if it hasn’t started yet

Source

fn bytes_per_sec(&self) -> Option<f64>

How many bytes per second are being read. None if it hasn’t started

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§