| 476 | } |
| 477 | |
| 478 | pub fn with_file_time_assert<F, Fut>(mut self, callback: F) -> Self |
| 479 | where |
| 480 | F: Fn(String, String) -> Fut + Send + Sync + 'static, |
| 481 | Fut: std::future::Future<Output = Result<(), ToolError>> + Send + 'static, |
| 482 | { |
| 483 | self.file_time_assert = Some(Arc::new(move |session_id, file_path| { |
| 484 | Box::pin(callback(session_id, file_path)) |
| 485 | })); |
| 486 | self |
| 487 | } |
| 488 | |
| 489 | pub async fn do_file_time_assert(&self, file_path: String) -> Result<(), ToolError> { |
| 490 | if let Some(ref callback) = self.file_time_assert { |