pub struct ProgressTracker { /* private fields */ }Expand description
Tracks progress for long-running operations and sends notifications.
Implementations§
Source§impl ProgressTracker
impl ProgressTracker
Sourcepub fn new(notification_tx: Sender<JsonRpcNotification>) -> Self
pub fn new(notification_tx: Sender<JsonRpcNotification>) -> Self
Create a new progress tracker with a notification channel.
Sourcepub async fn start(&self, total: Option<f64>) -> String
pub async fn start(&self, total: Option<f64>) -> String
Start tracking a new operation. Returns a unique token.
Sourcepub async fn update(&self, token: &str, current: f64) -> McpResult<()>
pub async fn update(&self, token: &str, current: f64) -> McpResult<()>
Update the progress of an operation.
Sourcepub async fn is_cancelled(&self, token: &str) -> bool
pub async fn is_cancelled(&self, token: &str) -> bool
Check if an operation has been cancelled.
Auto Trait Implementations§
impl Freeze for ProgressTracker
impl !RefUnwindSafe for ProgressTracker
impl Send for ProgressTracker
impl Sync for ProgressTracker
impl Unpin for ProgressTracker
impl UnsafeUnpin for ProgressTracker
impl !UnwindSafe for ProgressTracker
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