[−][src]Struct linya::Progress
A progress bar "coordinator" to share between threads.
Implementations
impl Progress
[src]
pub fn new() -> Progress
[src]
Initialize a new progress bar coordinator.
pub fn with_capacity(capacity: usize) -> Progress
[src]
Like Progress::new
but accepts a size hint to avoid reallocation as bar count grows.
pub fn bar<S: Into<String>>(&mut self, total: usize, label: S) -> Bar
[src]
Create a new progress bar with default styling and receive an owned handle to it.
Panics
Passing 0
to this function will cause a panic the first time a draw is
attempted.
pub fn set(&mut self, bar: &Bar, value: usize)
[src]
Set a particular Bar
's progress value, but don't draw it.
pub fn draw(&mut self, bar: &Bar)
[src]
Force the drawing of a particular Bar
.
Note 1: Drawing will only occur if there is something meaningful to show. Namely, if the progress has advanced at least 1% since the last draw.
Note 2: If your program is not being run in a terminal, an initial empty bar will be printed but never refreshed.
pub fn set_and_draw(&mut self, bar: &Bar, value: usize)
[src]
Set a Bar
's value and immediately try to draw it.
pub fn inc(&mut self, bar: &Bar, value: usize)
[src]
Increment a given Bar
's progress, but don't draw it.
pub fn inc_and_draw(&mut self, bar: &Bar, value: usize)
[src]
Increment a given Bar
's progress and immediately try to draw it.
pub fn is_done(&self, bar: &Bar) -> bool
[src]
Has the given bar completed?
pub fn cancel(&mut self, bar: Bar)
[src]
Cancel the given bar, say in the case of download failure, etc.
This fills the bar with the "cancel" character and consumes Bar
ownership so that the bar cannot be manipulated again.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Progress
[src]
impl Send for Progress
[src]
impl Sync for Progress
[src]
impl Unpin for Progress
[src]
impl UnwindSafe for Progress
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,