(mut self, callback: F)
| 603 | } |
| 604 | |
| 605 | pub fn with_todo_get<F, Fut>(mut self, callback: F) -> Self |
| 606 | where |
| 607 | F: Fn(String) -> Fut + Send + Sync + 'static, |
| 608 | Fut: std::future::Future<Output = Result<Vec<TodoItemData>, ToolError>> + Send + 'static, |
| 609 | { |
| 610 | self.todo_get = Some(Arc::new(move |session_id| Box::pin(callback(session_id)))); |
| 611 | self |
| 612 | } |
| 613 | |
| 614 | pub async fn do_todo_get(&self) -> Result<Vec<TodoItemData>, ToolError> { |
| 615 | if let Some(ref callback) = self.todo_get { |