pub trait ProgressIterator{
// Required method
fn progress_with(self, progress: ProgressBar) -> ProgressBarIter<Self> ⓘ;
// Provided methods
fn try_progress(self) -> Option<ProgressBarIter<Self>> { ... }
fn progress(self) -> ProgressBarIter<Self> ⓘ
where Self: ExactSizeIterator { ... }
fn progress_count(self, len: u64) -> ProgressBarIter<Self> ⓘ { ... }
fn progress_with_style(self, style: ProgressStyle) -> ProgressBarIter<Self> ⓘ
where Self: ExactSizeIterator { ... }
}
Expand description
Wraps an iterator to display its progress.
Required Methods§
Sourcefn progress_with(self, progress: ProgressBar) -> ProgressBarIter<Self> ⓘ
fn progress_with(self, progress: ProgressBar) -> ProgressBarIter<Self> ⓘ
Wrap an iterator with a custom progress bar.
Provided Methods§
Sourcefn try_progress(self) -> Option<ProgressBarIter<Self>>
fn try_progress(self) -> Option<ProgressBarIter<Self>>
Wrap an iterator with default styling. Uses Iterator::size_hint
to get length.
Returns Some(..)
only if size_hint.1
is Some
. If you want to create a progress bar
even if size_hint.1
returns None
use progress_count
or progress_with
instead.
Sourcefn progress(self) -> ProgressBarIter<Self> ⓘwhere
Self: ExactSizeIterator,
fn progress(self) -> ProgressBarIter<Self> ⓘwhere
Self: ExactSizeIterator,
Wrap an iterator with default styling.
Sourcefn progress_count(self, len: u64) -> ProgressBarIter<Self> ⓘ
fn progress_count(self, len: u64) -> ProgressBarIter<Self> ⓘ
Wrap an iterator with an explicit element count.
Sourcefn progress_with_style(self, style: ProgressStyle) -> ProgressBarIter<Self> ⓘwhere
Self: ExactSizeIterator,
fn progress_with_style(self, style: ProgressStyle) -> ProgressBarIter<Self> ⓘwhere
Self: ExactSizeIterator,
Wrap an iterator with a progress bar and style it.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.