pub struct TaskList {
pub session_id: String,
pub tasks: Vec<Task>,
pub current_task_id: Option<String>,
}Expand description
A list of tasks for a session
Fields§
§session_id: StringSession ID
tasks: Vec<Task>All tasks in this session
current_task_id: Option<String>Optional “current task” pointer for UI focus and checkpoint/rewind.
This is persisted alongside the task list so the UI can restore the user’s current focus when resuming a session.
Implementations§
Source§impl TaskList
impl TaskList
Sourcepub fn current_task_id(&self) -> Option<&str>
pub fn current_task_id(&self) -> Option<&str>
Get the currently focused task id.
Sourcepub fn set_current_task_id(
&mut self,
task_id: Option<String>,
) -> Result<(), TaskError>
pub fn set_current_task_id( &mut self, task_id: Option<String>, ) -> Result<(), TaskError>
Set or clear the current task pointer.
If task_id is Some, the id must exist in this task list.
Sourcepub fn find_task_mut(&mut self, task_id: &str) -> Option<&mut Task>
pub fn find_task_mut(&mut self, task_id: &str) -> Option<&mut Task>
Find a task by ID (mutable)
Sourcepub fn remove_task(&mut self, task_id: &str) -> Option<Task>
pub fn remove_task(&mut self, task_id: &str) -> Option<Task>
Remove a task by ID
Sourcepub fn root_tasks(&self) -> Vec<&Task>
pub fn root_tasks(&self) -> Vec<&Task>
Get all root tasks (tasks without a parent)
Sourcepub fn descendants(&self, task_id: &str) -> Vec<&Task>
pub fn descendants(&self, task_id: &str) -> Vec<&Task>
Get all descendant tasks of a given task in depth-first order.
Sourcepub fn is_task_blocked(&self, task_id: &str) -> Result<bool, TaskError>
pub fn is_task_blocked(&self, task_id: &str) -> Result<bool, TaskError>
Return true when the task is blocked by any dependency that is not terminal.
Sourcepub fn add_dependency(
&mut self,
task_id: &str,
blocked_by_id: &str,
) -> Result<(), TaskError>
pub fn add_dependency( &mut self, task_id: &str, blocked_by_id: &str, ) -> Result<(), TaskError>
Add a dependency relationship: task_id is blocked by blocked_by_id.
This enforces:
- both tasks must exist
- no self-dependencies
- no cycles across
blocked_byrelationships
Sourcepub fn build_tree(&self) -> Vec<TaskTreeNode>
pub fn build_tree(&self) -> Vec<TaskTreeNode>
Build a recursive task tree.
Nodes are ordered by sort_order then creation time.
Tasks referencing a missing parent are treated as roots.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TaskList
impl<'de> Deserialize<'de> for TaskList
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for TaskList
impl RefUnwindSafe for TaskList
impl Send for TaskList
impl Sync for TaskList
impl Unpin for TaskList
impl UnsafeUnpin for TaskList
impl UnwindSafe for TaskList
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].