pub struct ReaderProgress {
pub bytes_read: u64,
pub total_bytes: Option<u64>,
}Expand description
A snapshot of a reader’s consumption progress, obtained via PbfReader::progress
(or IterableReader::progress / any Deref-inheriting reader with sequential
semantics). Callers can poll it at their own rate (e.g. every 250 ms) to render a
progress bar.
Progress is byte-based: bytes_read is the stream position and is only meaningful for
sequential reads — random-access readers (CachedReader after a seek) report the
position of the current seek, not a global progress.
Fields§
§bytes_read: u64Bytes consumed from the stream so far (equals the total length at EOF).
total_bytes: Option<u64>Total stream length; None when unknown (e.g. non-file streams).
Implementations§
Trait Implementations§
Source§impl Clone for ReaderProgress
impl Clone for ReaderProgress
Source§fn clone(&self) -> ReaderProgress
fn clone(&self) -> ReaderProgress
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for ReaderProgress
Source§impl Debug for ReaderProgress
impl Debug for ReaderProgress
impl Eq for ReaderProgress
Source§impl PartialEq for ReaderProgress
impl PartialEq for ReaderProgress
impl StructuralPartialEq for ReaderProgress
Auto Trait Implementations§
impl Freeze for ReaderProgress
impl RefUnwindSafe for ReaderProgress
impl Send for ReaderProgress
impl Sync for ReaderProgress
impl Unpin for ReaderProgress
impl UnsafeUnpin for ReaderProgress
impl UnwindSafe for ReaderProgress
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more