Skip to main content

ProgressWithStop

Struct ProgressWithStop 

Source
pub struct ProgressWithStop<S, R> {
    pub stop: S,
    pub report: R,
}
Expand description

A stop policy and a progress sink used as one value.

check goes to stop and advance goes to report, so the pair works wherever Stop + Report is expected, including ProgressExt::step. ProgressWithStop::new(Unstoppable, NoReport) is zero-sized.

Fields§

§stop: S

The cancellation policy.

§report: R

The completed-work sink.

Implementations§

Source§

impl<S, R> ProgressWithStop<S, R>

Source

pub const fn new(stop: S, report: R) -> Self

Pair a stop policy with a progress sink.

Trait Implementations§

Source§

impl<S: Clone, R: Clone> Clone for ProgressWithStop<S, R>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<S: Copy, R: Copy> Copy for ProgressWithStop<S, R>

Source§

impl<S: Debug, R: Debug> Debug for ProgressWithStop<S, R>

Source§

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

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

impl<S: Default, R: Default> Default for ProgressWithStop<S, R>

Source§

fn default() -> Self

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

impl<S: Eq, R: Eq> Eq for ProgressWithStop<S, R>

Source§

impl<S: Hash, R: Hash> Hash for ProgressWithStop<S, R>

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<S: PartialEq, R: PartialEq> PartialEq for ProgressWithStop<S, R>

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl<S: Send + Sync, R: Report> Report for ProgressWithStop<S, R>

Source§

fn advance(&self, completed: u64)

Add completed finished units.
Source§

fn may_report(&self) -> bool

Whether reports have any effect. Read more
Source§

impl<S: Stop, R: Send + Sync> Stop for ProgressWithStop<S, R>

Source§

fn check(&self) -> Result<(), StopReason>

Check if the operation should stop. Read more
Source§

fn may_stop(&self) -> bool

Returns true if this stop can ever signal a stop. Read more
Source§

fn should_stop(&self) -> bool

Returns true if the operation should stop. Read more
Source§

impl<S: PartialEq, R: PartialEq> StructuralPartialEq for ProgressWithStop<S, R>

Auto Trait Implementations§

§

impl<S, R> Freeze for ProgressWithStop<S, R>
where S: Freeze, R: Freeze,

§

impl<S, R> RefUnwindSafe for ProgressWithStop<S, R>

§

impl<S, R> Send for ProgressWithStop<S, R>
where S: Send, R: Send,

§

impl<S, R> Sync for ProgressWithStop<S, R>
where S: Sync, R: Sync,

§

impl<S, R> Unpin for ProgressWithStop<S, R>
where S: Unpin, R: Unpin,

§

impl<S, R> UnsafeUnpin for ProgressWithStop<S, R>
where S: UnsafeUnpin, R: UnsafeUnpin,

§

impl<S, R> UnwindSafe for ProgressWithStop<S, R>
where S: UnwindSafe, R: UnwindSafe,

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> ProgressExt for T
where T: Stop + Report + ?Sized,

Source§

fn step(&self, completed: u64) -> Result<(), StopReason>

Count completed finished units, then check for cancellation. Read more
Source§

fn live(&self) -> Option<&Self>

The live pulse: this value, or None when it can neither stop nor report. Read more
Source§

fn split_array<const N: usize>( &self, execution: Execution, parts: [PhaseSpec<'_>; N], ) -> Result<[Child<'_>; N], PlanError>
where Self: Pulse,

Pulse::split into exactly N children, returned as an array. Read more
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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.