pub struct RunningProgressPoints { /* private fields */ }Expand description
Worker-side handle for reporting running progress points.
RunningProgressPoints deliberately cannot stop or join the reporter
thread. It only wakes the reporter loop for zero-interval progress. For
positive intervals, Self::running_point is a no-op because the reporter
loop wakes itself on timeout.
§Examples
use std::{
thread,
time::Duration,
};
use qubit_progress::{
NoOpProgressReporter,
Progress,
ProgressCounters,
RunningProgressLoop,
};
let reporter = NoOpProgressReporter;
thread::scope(|scope| {
let progress = Progress::new(&reporter, Duration::ZERO);
let running_progress =
RunningProgressLoop::spawn_scoped(scope, progress, || {
ProgressCounters::new(Some(1)).with_completed_count(1)
});
let progress_points = running_progress.points();
assert!(progress_points.running_point());
running_progress.stop_and_join();
});§Author
Haixing Hu
Implementations§
Source§impl RunningProgressPoints
impl RunningProgressPoints
Sourcepub fn running_point(&self) -> bool
pub fn running_point(&self) -> bool
Reports one worker running progress point.
§Returns
true when the point was accepted or no point signal is required.
Returns false only when a required zero-interval signal could not be
sent because the reporter loop has already stopped.
Trait Implementations§
Source§impl Clone for RunningProgressPoints
impl Clone for RunningProgressPoints
Source§fn clone(&self) -> RunningProgressPoints
fn clone(&self) -> RunningProgressPoints
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for RunningProgressPoints
impl RefUnwindSafe for RunningProgressPoints
impl Send for RunningProgressPoints
impl Sync for RunningProgressPoints
impl Unpin for RunningProgressPoints
impl UnsafeUnpin for RunningProgressPoints
impl UnwindSafe for RunningProgressPoints
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