Skip to main content

SharedPulse

Struct SharedPulse 

Source
pub struct SharedPulse(/* private fields */);
Expand description

An owned, cloneable pulse that retains planning and cancellation capabilities. The original phase owner alone may finish it. Requires pointer atomics.

A shared view has no completion operation:

ⓘ
use how_far::{Outcome, SharedPulse};
let shared = SharedPulse::default();
shared.finish(Outcome::Succeeded).unwrap();

Implementations§

Source§

impl SharedPulse

Source

pub fn paced(&self, every: u64) -> Paced<'_>

Checkpoints that reach this shared pulse once every every units; see Paced. One per worker, like any Paced.

Source§

impl SharedPulse

Source

pub fn new(pulse: impl Pulse + 'static) -> SharedPulse

Erase an owned implementation. The implementation must not own the phase’s completion token: dropping clones must not finish the phase.

Source

pub fn as_pulse(&self) -> &dyn Pulse

Borrow the underlying pulse, preserving the canonical no-op fast path.

Source

pub fn plan( &self, execution: Execution, parts: &[PhaseSpec<'_>], ) -> Vec<Child<'_>>

Best-effort planning, as for a borrowed pulse; see <dyn Pulse>::plan.

Trait Implementations§

Source§

impl Clone for SharedPulse

Source§

fn clone(&self) -> SharedPulse

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 Debug for SharedPulse

Source§

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

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

impl Default for SharedPulse

Source§

fn default() -> SharedPulse

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

impl Pulse for SharedPulse

Source§

fn record_issue(&self, error: PlanError)

Record a reporting-protocol problem for optional diagnostics. This never changes cancellation or the operation’s return value. Ordinary sinks may ignore it; diagnostic wrappers retain bounded evidence.
Source§

fn split( &self, execution: Execution, parts: &[PhaseSpec<'_>], ) -> Result<Vec<Child<'_>>, PlanError>

Split this phase into weighted children, in declared order. Read more
Source§

fn start(&self) -> Result<(), PlanError>

Mark this phase running, without counting or ending planning. Implementations without lifecycle observations may ignore this.
Source§

fn set_total(&self, total: Total) -> Result<(), PlanError>

Revise a leaf’s denominator without changing completed units or weights. Unsupported implementations return an error instead of losing the update.
Source§

fn share(&self) -> Result<SharedPulse, PlanError>

Share all pulse capabilities with owned work, but never completion rights. Read more
Source§

impl Report for SharedPulse

Source§

fn advance(&self, n: u64)

Add completed finished units.
Source§

fn may_report(&self) -> bool

Whether reports have any effect. Read more
Source§

impl Stop for SharedPulse

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

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

Source§

fn batched(self, threshold: NonZeroU64) -> Batch<Self>
where Self: Sized,

Buffer one worker’s reports, publishing them in batches of at least threshold units, and the remainder on Batch::flush or drop. 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.