| 495 | } |
| 496 | |
| 497 | pub fn with_file_time_read<F, Fut>(mut self, callback: F) -> Self |
| 498 | where |
| 499 | F: Fn(String, String) -> Fut + Send + Sync + 'static, |
| 500 | Fut: std::future::Future<Output = Result<(), ToolError>> + Send + 'static, |
| 501 | { |
| 502 | self.file_time_read = Some(Arc::new(move |session_id, file_path| { |
| 503 | Box::pin(callback(session_id, file_path)) |
| 504 | })); |
| 505 | self |
| 506 | } |
| 507 | |
| 508 | pub async fn do_file_time_read(&self, file_path: String) -> Result<(), ToolError> { |
| 509 | if let Some(ref callback) = self.file_time_read { |