Struct progress::Bar
[−]
[src]
pub struct Bar { /* fields omitted */ }
Struct that used for presenting progress bar with plain texts.
It looks like:
Doing something [===-------] 70%
Examples
use std::thread; extern crate progress; fn main() { let bar = progress::Bar::new(); bar.set_job_title("Working..."); for i in 0..11 { thread::sleep_ms(100); bar.reach_percent(i * 10); } }
Methods
impl Bar
[src]
fn new() -> Bar
Create a new progress bar.
fn jobs_done(&mut self)
Reset progress percentage to zero and job title to empty string. Also prints "\n".
fn set_job_title(&mut self, new_title: &str)
Set text shown in progress bar.
fn reach_percent(&mut self, percent: i32)
Put progress to given percentage.
fn add_percent(&mut self, progress: i32)
Increase progress with given percentage.