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<TaskList, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<TaskList, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for TaskList
impl Serialize for TaskList
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
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.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
§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>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§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].