[][src]Struct librsyncr::ProgressReader

pub struct ProgressReader<R: Read> { /* fields omitted */ }

A Read adaptor that calls a callback every so often as data is read from it so that the progress of an operation can be reported.

Methods

impl<R: Read> ProgressReader<R>[src]

pub fn new(inner: R, total_len: u64, callback: Box<dyn FnMut(f32)>) -> Self[src]

Creates a new ProgressReader. The total_len is the total number of bytes in the operation and the callback is the function to be called after every (currently) 1% has been read.

pub fn read_len(&self) -> u64[src]

Returns the number of bytes that have been read so far.

Trait Implementations

impl<R: Read> Read for ProgressReader<R>[src]

Auto Trait Implementations

impl<R> !Send for ProgressReader<R>

impl<R> !Sync for ProgressReader<R>

impl<R> Unpin for ProgressReader<R> where
    R: Unpin

impl<R> !UnwindSafe for ProgressReader<R>

impl<R> !RefUnwindSafe for ProgressReader<R>

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<R> ReadBytesExt for R where
    R: Read + ?Sized
[src]