pub struct ProgressToken<S> { /* private fields */ }
Expand description
A token that tracks the progress of a task and can be organized hierarchically
Implementations§
Source§impl<S: Clone + Send + 'static> ProgressToken<S>
impl<S: Clone + Send + 'static> ProgressToken<S>
Sourcepub fn child(parent: &Arc<Self>, weight: f64, status: impl Into<S>) -> Arc<Self>
pub fn child(parent: &Arc<Self>, weight: f64, status: impl Into<S>) -> Arc<Self>
Create a child token
Sourcepub fn indeterminate(&self)
pub fn indeterminate(&self)
Set the progress state to indeterminate
Sourcepub fn is_cancelled(&self) -> bool
pub fn is_cancelled(&self) -> bool
Check if this token has been cancelled
pub fn cancelled(&self) -> WaitForCancellationFuture<'_>
pub async fn updated(&self) -> Result<ProgressUpdate<S>, ProgressError>
Sourcepub fn subscribe(&self) -> ProgressStream<'_, S>
pub fn subscribe(&self) -> ProgressStream<'_, S>
Subscribe to progress updates from this token
Trait Implementations§
Source§impl<S: Clone> Clone for ProgressToken<S>
impl<S: Clone> Clone for ProgressToken<S>
Source§fn clone(&self) -> ProgressToken<S>
fn clone(&self) -> ProgressToken<S>
Returns a copy of the value. Read more
1.0.0 · 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<S> Freeze for ProgressToken<S>
impl<S> RefUnwindSafe for ProgressToken<S>
impl<S> Send for ProgressToken<S>where
S: Send,
impl<S> Sync for ProgressToken<S>where
S: Send,
impl<S> Unpin for ProgressToken<S>
impl<S> UnwindSafe for ProgressToken<S>
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