(mut self, callback: F)
| 531 | } |
| 532 | |
| 533 | pub fn with_update_part<F, Fut>(mut self, callback: F) -> Self |
| 534 | where |
| 535 | F: Fn(serde_json::Value) -> Fut + Send + Sync + 'static, |
| 536 | Fut: std::future::Future<Output = Result<(), ToolError>> + Send + 'static, |
| 537 | { |
| 538 | self.update_part = Some(Arc::new(move |part| Box::pin(callback(part)))); |
| 539 | self |
| 540 | } |
| 541 | |
| 542 | pub async fn do_update_part(&self, part: serde_json::Value) -> Result<(), ToolError> { |
| 543 | if let Some(ref callback) = self.update_part { |