pub struct ProgressBar<'a> {
pub current: u32,
pub max: u32,
pub max_time: u32,
pub style: Style<'a>,
}Expand description
This is the progress bar struct
ยงUsage
use pgbar::{ProgressBar, Style};
use termion::color;
let mut progress_bar = ProgressBar::new(100, 10, Style {
symbol: String::from("*"), // The progress bar will be filled with *
color: Some(&color::Cyan), // This is the color of the progress bar
width: 50, // This is the width of the progress bar
time_to_finish: true, // This is the time to finish the progress bar
wrapper: String::from("[]"), // This is the wrapper of the progress bar
});
progress_bar.track(); // This will start the progress bar
progress_bar.update(50); // This will update the progress bar
progress_bar.finish(); // This will finish the progress bar
progress_bar.recover(); // This will recover the progress bar
progress_bar.reset(); // This will reset the progress bar to 0Fieldsยง
ยงcurrent: u32The current progress
max: u32The max progress
max_time: u32The max time to finish the progress bar in seconds
style: Style<'a>The style of the progress bar defined in the Style struct
Implementationsยง
Sourceยงimpl ProgressBar<'_>
impl ProgressBar<'_>
Auto Trait Implementationsยง
impl<'a> Freeze for ProgressBar<'a>
impl<'a> !RefUnwindSafe for ProgressBar<'a>
impl<'a> !Send for ProgressBar<'a>
impl<'a> !Sync for ProgressBar<'a>
impl<'a> Unpin for ProgressBar<'a>
impl<'a> !UnwindSafe for ProgressBar<'a>
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