pub struct TaskTree { /* private fields */ }Expand description
Tracks the current agent task tree from background_tasks_changed events.
Implementations§
Source§impl TaskTree
impl TaskTree
pub fn new() -> Self
Sourcepub fn update(&mut self, tasks: Vec<BackgroundTask>)
pub fn update(&mut self, tasks: Vec<BackgroundTask>)
Update with a new snapshot (replace semantics).
pub fn tasks(&self) -> &[BackgroundTask]
Sourcepub fn get(&self, id: &str) -> Option<&BackgroundTask>
pub fn get(&self, id: &str) -> Option<&BackgroundTask>
Find a task by ID.
Sourcepub fn children(&self, parent_id: &str) -> Vec<&BackgroundTask>
pub fn children(&self, parent_id: &str) -> Vec<&BackgroundTask>
All direct children of a parent task.
Trait Implementations§
Auto Trait Implementations§
impl Forget for TaskTree
impl Freeze for TaskTree
impl Move for TaskTree
impl RefUnwindSafe for TaskTree
impl Send for TaskTree
impl Sync for TaskTree
impl Unpin for TaskTree
impl UnsafeUnpin for TaskTree
impl UnwindSafe for TaskTree
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