Cancel all pending confirmations
(&self)
| 406 | |
| 407 | /// Cancel all pending confirmations |
| 408 | pub async fn cancel_all(&self) -> usize { |
| 409 | let pending_list: Vec<_> = { |
| 410 | let mut pending_map = self.pending.write().await; |
| 411 | pending_map.drain().collect() |
| 412 | }; |
| 413 | |
| 414 | let count = pending_list.len(); |
| 415 | |
| 416 | for (_, confirmation) in pending_list { |
| 417 | let response = ConfirmationResponse { |
| 418 | approved: false, |
| 419 | reason: Some("Confirmation cancelled".to_string()), |
| 420 | }; |
| 421 | let _ = confirmation.response_tx.send(response); |
| 422 | } |
| 423 | |
| 424 | count |
| 425 | } |
| 426 | } |
| 427 | |
| 428 | // Implement ConfirmationProvider trait for ConfirmationManager |