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 update_progress(&self, progress: f64)
pub fn update_progress(&self, progress: f64)
Update the progress of this token
Sourcepub fn update_indeterminate(&self)
pub fn update_indeterminate(&self)
Set the progress state to indeterminate
Sourcepub fn update_status(&self, status: impl Into<S>)
pub fn update_status(&self, status: impl Into<S>)
Update the status message
Sourcepub fn update(&self, progress: Progress, status: impl Into<S>)
pub fn update(&self, progress: Progress, status: impl Into<S>)
Update the progress and status message
Sourcepub fn check(&self) -> Result<(), ProgressError>
pub fn check(&self) -> Result<(), ProgressError>
Returns ProgressError::Cancelled if the token is cancelled, otherwise Ok.
pub fn is_cancelled(&self) -> bool
pub fn cancelled(&self) -> WaitForCancellationFuture<'_>
pub fn cancelled_owned(self) -> WaitForCancellationFutureOwned
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
Sourcepub fn complete_guard(&self) -> CompleteGuard<'_, S>
pub fn complete_guard(&self) -> CompleteGuard<'_, S>
Creates a guard that will automatically mark this token as complete when dropped
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 moreSource§impl<S: Debug> Debug for ProgressToken<S>
impl<S: Debug> Debug for ProgressToken<S>
Auto 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