pub struct Progresso { /* private fields */ }Implementations§
Source§impl Progresso
impl Progresso
Sourcepub fn new(style: Style) -> Progresso
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
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
impl ProgressoBar for Progresso
fn get_total(&self) -> u64
fn set_total(&mut self, max: u64)
fn get_value(&self) -> u64
fn set_value(&mut self, val: u64)
fn get_display_len(&self) -> usize
fn set_display_len(&mut self, val: usize)
fn erase(&self)
fn erase_to(&self, writer: &mut dyn Write)
fn draw(&self)
fn draw_to(&self, writer: &mut dyn Write)
Auto Trait Implementations§
impl Freeze for Progresso
impl RefUnwindSafe for Progresso
impl Send for Progresso
impl Sync for Progresso
impl Unpin for Progresso
impl UnwindSafe for Progresso
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