pub struct ProgressUpdater { /* private fields */ }std only.Expand description
A handle for updating progress during execution of a future.
This struct allows you to report progress updates that will be broadcast to listeners via the progress stream. It maintains internal state and automatically handles cancellation when dropped.
Implementations§
Source§impl ProgressUpdater
impl ProgressUpdater
Sourcepub fn update_with_message(&mut self, current: u64, message: impl Into<String>)
pub fn update_with_message(&mut self, current: u64, message: impl Into<String>)
Updates the progress with the given current value and message.
This will broadcast the update to all progress stream listeners.
Sourcepub fn update(&mut self, current: u64)
pub fn update(&mut self, current: u64)
Updates the progress with the given current value.
This will broadcast the update to all progress stream listeners.
Sourcepub fn pause(&self)
pub fn pause(&self)
Pauses the progress operation.
This method sets the progress state to paused and broadcasts the update to all listeners.
Sourcepub fn complete(&mut self)
pub fn complete(&mut self)
Marks the progress operation as completed.
This method sets the completed flag and broadcasts a completion update. Subsequent calls to this method have no effect.
Sourcepub fn pause_with_message(&self, message: impl Into<String>)
pub fn pause_with_message(&self, message: impl Into<String>)
Pauses the progress operation with a descriptive message.
This method sets the progress state to paused and broadcasts the update to all listeners.
Trait Implementations§
Source§impl Clone for ProgressUpdater
impl Clone for ProgressUpdater
Source§fn clone(&self) -> ProgressUpdater
fn clone(&self) -> ProgressUpdater
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source. Read more