Progresso

Struct Progresso 

Source
pub struct Progresso { /* private fields */ }

Implementations§

Source§

impl Progresso

Source

pub fn new(style: Style) -> Progresso

Examples found in repository?
examples/simple.rs (line 9)
5fn main()
6{
7    let mut style = Style::default_ascii();
8    style.value_display = ValueDisplay::Percentage;
9    let mut pb = Progresso::new(style);
10
11    pb.set_total(400);
12    for i in 0..401 {
13        pb.erase();
14        pb.set_value(i);
15        pb.draw();
16        thread::sleep(std::time::Duration::from_millis(25));
17    }
18}
More examples
Hide additional examples
examples/simple_block.rs (line 9)
5fn main()
6{
7    let mut style = Style::new_smooth_unicode();
8    style.value_display = ValueDisplay::Percentage;
9    let mut pb = Progresso::new(style);
10
11    pb.set_total(400);
12    for i in 0..401 {
13        pb.erase();
14        pb.set_value(i);
15        pb.draw();
16        thread::sleep(std::time::Duration::from_millis(5));
17    }
18
19    let mut style = Style::new_climbing_blocks_unicode();
20    style.value_display = ValueDisplay::Percentage;
21    let mut pb = Progresso::new(style);
22
23    pb.set_total(400);
24    for i in 0..401 {
25        pb.erase();
26        pb.set_value(i);
27        pb.draw();
28        thread::sleep(std::time::Duration::from_millis(50));
29    }
30}

Trait Implementations§

Source§

impl ProgressoBar for Progresso

Source§

fn get_total(&self) -> u64

Source§

fn set_total(&mut self, max: u64)

Source§

fn get_value(&self) -> u64

Source§

fn set_value(&mut self, val: u64)

Source§

fn get_display_len(&self) -> usize

Source§

fn set_display_len(&mut self, val: usize)

Source§

fn erase(&self)

Source§

fn erase_to(&self, writer: &mut dyn Write)

Source§

fn draw(&self)

Source§

fn draw_to(&self, writer: &mut dyn Write)

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.