Struct Step

Source
pub struct Step { /* private fields */ }
Expand description

A small struct that holds iteration count, elapsed time etc for each algorithm step. The elapsed time is calculated on first call or on Clone.

The callbacks on_step and converge_when give access to a Step structure.

Implementations§

Source§

impl Step

Source

pub fn iteration(&self) -> usize

The iteration count.

Represents how many times ‘step’ has been invoked. Hence the first iteration is 1.

Source

pub fn elapsed(&self) -> Duration

Total elapsed time since the call to crate::Driver::solve.

The elapsed time is only updated after each iteration step, and will not change between calls otherwise.

§See also
Source

pub fn progress_percentage(&self) -> Option<f64>

An estimate between 0 and 100 of how complete the solving process is.

The most optimistic of

  • iterations out of iters, or
  • elapsed time out of of “fail after” duration

will be used for the estimate.

Source

pub fn clone_without_elapsed(&self) -> Self

A version of Self::clone that does not crystalize the elapsed time at clone time, and hence is slightly more performant.

Source

pub fn time_remaining(&self) -> Option<Duration>

An estimate of the time remaining.

The estimate is based on Self::progress_percentage, and how much time has elapsed so far.

Trait Implementations§

Source§

impl Clone for Step

Clone but with the side-effect of crystalizing the elapsed time

Elapsed is calculated at clone time, if it has not already been calculated. This is typically want you want, but if the overhead of calculating the time is not desired, and using the elapsed time is not needed, then Step::clone_without_elapsed can be called

Source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Step

Source§

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

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

impl Display for Step

Source§

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

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

impl PartialEq for Step

Source§

fn eq(&self, other: &Step) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Sampler<&Step> for ProgressBar<'_>

Source§

fn sample(&mut self, step: &Step) -> SamplingOutcome<&'static Step>

Source§

impl Eq for Step

Source§

impl StructuralPartialEq for Step

Auto Trait Implementations§

§

impl !Freeze for Step

§

impl RefUnwindSafe for Step

§

impl Send for Step

§

impl Sync for Step

§

impl Unpin for Step

§

impl UnwindSafe for Step

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

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>,

Source§

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>,

Source§

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.