pub struct TaskManager { /* private fields */ }Expand description
任务管理器,负责 CRUD 操作和持久化
Implementations§
Source§impl TaskManager
impl TaskManager
pub fn new() -> Self
Sourcepub fn new_with_session(session_id: &str) -> Self
pub fn new_with_session(session_id: &str) -> Self
创建 session 级 TaskManager(存储到 sessions/{id}/tasks.json)
pub fn create_task( &self, title: &str, description: &str, blocked_by: Vec<u64>, task_doc_paths: Vec<String>, ) -> Result<AgentTask, String>
Sourcepub fn list_ready_tasks(&self) -> Vec<AgentTask>
pub fn list_ready_tasks(&self) -> Vec<AgentTask>
Return tasks that are pending and have no unresolved blockers (ready to work on)
pub fn get_task(&self, id: u64) -> Result<AgentTask, String>
pub fn list_tasks(&self) -> Vec<AgentTask>
pub fn update_task(&self, id: u64, updates: &Value) -> Result<AgentTask, String>
Sourcepub fn replace_all(&self, new_tasks: Vec<AgentTask>)
pub fn replace_all(&self, new_tasks: Vec<AgentTask>)
替换所有任务(session 恢复时使用)
Trait Implementations§
Source§impl Debug for TaskManager
impl Debug for TaskManager
Auto Trait Implementations§
impl !Freeze for TaskManager
impl RefUnwindSafe for TaskManager
impl Send for TaskManager
impl Sync for TaskManager
impl Unpin for TaskManager
impl UnsafeUnpin for TaskManager
impl UnwindSafe for TaskManager
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.