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

source

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

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Display for ProgressLogger

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl ProgressLog for ProgressLogger

source§

fn light_update(&mut self)

Increases the count and, once every LIGHT_UPDATE_MASK + 1 calls, check whether it is time to log.

source§

fn display_memory(&mut self, display_memory: bool) -> &mut Self

Sets the display of memory information. Read more
source§

fn item_name(&mut self, item_name: impl AsRef<str>) -> &mut Self

Sets the name of an item.
source§

fn log_interval(&mut self, log_interval: Duration) -> &mut Self

Sets the log interval.
source§

fn expected_updates(&mut self, expected_updates: Option<usize>) -> &mut Self

Sets the expected number of updates. Read more
source§

fn time_unit(&mut self, time_unit: Option<TimeUnit>) -> &mut Self

Sets the time unit to use for speed. Read more
source§

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 log_target(&mut self, target: impl AsRef<str>) -> &mut Self

Sets the log target. Read more
source§

fn start(&mut self, msg: impl AsRef<str>)

Starts the logger, displaying the given message. Read more
source§

fn refresh(&mut self)

Refreshes 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(&mut self)

Increases the count and check whether it is time to log.
source§

fn update_with_count(&mut self, count: usize)

Sets the count and check whether it is time to log.
source§

fn update_and_display(&mut self)

Increases the count and forces a log.
source§

fn stop(&mut self)

Stops the logger, fixing the final time.
source§

fn done(&mut self)

Stops 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)

Stops the logger, sets the count, prints Completed., and displays the final stats. The number of expected updates will be cleared. Read more
source§

fn elapsed(&self) -> Option<Duration>

Returns the elapsed time since the logger was started, or None if the logger has not been started.
source§

fn info(&self, args: Arguments<'_>)

Outputs the given message. Read more
source§

fn clone(&self) -> Self

Clones the logger, returning a logger with the same setup but with all the counters reset.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.