comparison rust/hg-core/src/progress.rs @ 52065:3ae7c43ad8aa

rust: add `Progress` trait for progress bars This will be used in the next few changes to introduce a progress bar for the `hg update` fastpath.
author Rapha?l Gom?s <rgomes@octobus.net>
date Mon, 30 Sep 2024 16:02:30 +0200
parents
children 92e23ba257d1
comparison
equal deleted inserted replaced
52064:7c105b953ca4 52065:3ae7c43ad8aa
1 //! Progress-bar related things
2
3 /// A generic determinate progress bar trait
4 pub trait Progress: Send + Sync + 'static {
5 /// Set the current position and optionally the total
6 fn update(&self, pos: u64, total: Option<u64>);
7 /// Increment the current position and optionally the total
8 fn increment(&self, step: u64, total: Option<u64>);
9 /// Declare that progress is over and the progress bar should be deleted
10 fn complete(self);
11 }