[][src]Struct linya::Progress

pub struct Progress { /* fields omitted */ }

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

impl Debug for Progress[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

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

impl<T, U> Into<U> for T where
    U: From<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.