pub struct RunningProgressPointHandle { /* private fields */ }Expand description
Worker-side handle for reporting running progress points.
RunningProgressPointHandle deliberately cannot stop or join the reporter
thread. It only wakes the reporter loop for zero-interval progress. For
positive intervals, Self::report 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_point_handle = running_progress.point_handle();
assert!(progress_point_handle.report());
running_progress.stop_and_join();
});§Author
Haixing Hu
Implementations§
Trait Implementations§
Source§impl Clone for RunningProgressPointHandle
impl Clone for RunningProgressPointHandle
Source§fn clone(&self) -> RunningProgressPointHandle
fn clone(&self) -> RunningProgressPointHandle
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 RunningProgressPointHandle
impl RefUnwindSafe for RunningProgressPointHandle
impl Send for RunningProgressPointHandle
impl Sync for RunningProgressPointHandle
impl Unpin for RunningProgressPointHandle
impl UnsafeUnpin for RunningProgressPointHandle
impl UnwindSafe for RunningProgressPointHandle
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