Struct dsi_progress_logger::ProgressLogger
source · pub struct ProgressLogger { /* private fields */ }
Expand description
An implementation of ProgressLog
with output generated using the log
crate
at the info
level.
Implementations§
source§impl ProgressLogger
impl ProgressLogger
sourcepub const LIGHT_UPDATE_MASK: usize = 1_048_575usize
pub const LIGHT_UPDATE_MASK: usize = 1_048_575usize
Calls to light_update will cause a call to
Instant::now
only if the current count
is a multiple of this mask plus one.
Trait Implementations§
source§impl Default for ProgressLogger
impl Default for ProgressLogger
source§impl Display for ProgressLogger
impl Display for ProgressLogger
source§impl ProgressLog for ProgressLogger
impl ProgressLog for ProgressLogger
source§fn display_memory(&mut self, display_memory: bool) -> &mut Self
fn display_memory(&mut self, display_memory: bool) -> &mut Self
Chainable setter enabling memory display.
source§fn light_update(&mut self)
fn light_update(&mut self)
Increase the count and, once every LIGHT_UPDATE_MASK
+ 1 calls, check whether it is time to log.
source§fn log_interval(&mut self, log_interval: Duration) -> &mut Self
fn log_interval(&mut self, log_interval: Duration) -> &mut Self
Set the log interval.
source§fn expected_updates(&mut self, expected_updates: Option<usize>) -> &mut Self
fn expected_updates(&mut self, expected_updates: Option<usize>) -> &mut Self
Set the expected number of updates. Read more
source§fn time_unit(&mut self, time_unit: Option<TimeUnit>) -> &mut Self
fn time_unit(&mut self, time_unit: Option<TimeUnit>) -> &mut Self
Set the time unit to use for speed. Read more
source§fn local_speed(&mut self, local_speed: bool) -> &mut Self
fn local_speed(&mut self, local_speed: bool) -> &mut Self
Set whether to display additionally the speed achieved during the last log interval.
source§fn start(&mut self, msg: impl AsRef<str>)
fn start(&mut self, msg: impl AsRef<str>)
Start the logger, displaying the given message. Read more
source§fn refresh(&mut self)
fn refresh(&mut self)
Refresh memory information, if previously requested with
display_memory
.
You do not need to call this method unless you display the logger manually.source§fn update_with_count(&mut self, count: usize)
fn update_with_count(&mut self, count: usize)
Set the count and check whether it is time to log.
source§fn update_and_display(&mut self)
fn update_and_display(&mut self)
Increase the count and force a log.
source§fn done(&mut self)
fn done(&mut self)
Stop the logger, print
Completed.
, and display the final stats.
The number of expected updates will be cleared.source§fn done_with_count(&mut self, count: usize)
fn done_with_count(&mut self, count: usize)
Stop the logger, set the count, print
Completed.
, and display the final stats.
The number of expected updates will be cleared. Read moreAuto Trait Implementations§
impl RefUnwindSafe for ProgressLogger
impl Send for ProgressLogger
impl Sync for ProgressLogger
impl Unpin for ProgressLogger
impl UnwindSafe for ProgressLogger
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