pub struct WatchProgress<'a> { /* private fields */ }Expand description
ProgressSink adapter that mirrors ProgressSink::should_cancel into watch.
Implementations§
Source§impl<'a> WatchProgress<'a>
impl<'a> WatchProgress<'a>
Sourcepub fn new(inner: &'a mut dyn ProgressSink, watch: Arc<AtomicBool>) -> Self
pub fn new(inner: &'a mut dyn ProgressSink, watch: Arc<AtomicBool>) -> Self
Wrap inner so any cancel request on the sink sets watch.
Trait Implementations§
Source§impl ProgressSink for WatchProgress<'_>
impl ProgressSink for WatchProgress<'_>
Source§fn start(&mut self, phase: ProgressPhase, total: Option<u64>)
fn start(&mut self, phase: ProgressPhase, total: Option<u64>)
Begin a new progress
phase, optionally with a known total count of
ProgressPhase::default_unit units for that phase. Read moreSource§fn start_with_unit(
&mut self,
phase: ProgressPhase,
unit: ProgressUnit,
total: Option<u64>,
)
fn start_with_unit( &mut self, phase: ProgressPhase, unit: ProgressUnit, total: Option<u64>, )
Begin a phase with an explicit count unit (for example
ProgressUnit::Bytes
when streaming a pack whose size is known in bytes). Read moreSource§fn set(&mut self, current: u64)
fn set(&mut self, current: u64)
Set the absolute progress of the current phase to
current units.Source§fn should_cancel(&self) -> bool
fn should_cancel(&self) -> bool
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for WatchProgress<'a>
impl<'a> !Send for WatchProgress<'a>
impl<'a> !Sync for WatchProgress<'a>
impl<'a> !UnwindSafe for WatchProgress<'a>
impl<'a> Freeze for WatchProgress<'a>
impl<'a> Unpin for WatchProgress<'a>
impl<'a> UnsafeUnpin for WatchProgress<'a>
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