pub struct ProgressBar {
pub speed: u64,
/* private fields */
}Expand description
Single-task progress bar with speed estimation.
Renders a visual progress indicator: [=====> ] 45% (12.3MiB/s) ETA: 02:15
Automatically detects terminal width (via crossterm) and adapts
the bar width accordingly. Falls back to simple text on non-TTY output.
§Example
use aria2_core::ui::ProgressBar;
let mut pb = ProgressBar::new(1024 * 1024); // 1 MiB total
pb.update(512 * 1024);
pb.render(true); // force renderFields§
§speed: u64Implementations§
Source§impl ProgressBar
impl ProgressBar
pub fn new(total: u64) -> Self
pub fn update(&mut self, current: u64)
pub fn finish(&mut self)
pub fn render(&self, force: bool)
pub fn render_summary(&self) -> String
pub fn set_total(&mut self, total: u64)
pub fn current(&self) -> u64
pub fn total(&self) -> u64
pub fn is_complete(&self) -> bool
Auto Trait Implementations§
impl Freeze for ProgressBar
impl RefUnwindSafe for ProgressBar
impl Send for ProgressBar
impl Sync for ProgressBar
impl Unpin for ProgressBar
impl UnsafeUnpin for ProgressBar
impl UnwindSafe for ProgressBar
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