pub struct Task {Show 16 fields
pub id: String,
pub name: String,
pub description: String,
pub status: TaskStatus,
pub parent_id: Option<String>,
pub blocked_by: Vec<String>,
pub background_job: Option<TaskBackgroundJob>,
pub sort_order: i32,
pub phase: Option<String>,
pub created_at: DateTime<Utc>,
pub updated_at: DateTime<Utc>,
pub session_id: String,
pub source: TaskSource,
pub orchestrator_task_id: Option<String>,
pub agent_id: Option<String>,
pub metadata: Option<Value>,
}Expand description
A task represents a unit of work to be tracked
Fields§
§id: StringUnique identifier for this task
name: StringHuman-readable name
description: StringDetailed description
status: TaskStatusCurrent status
parent_id: Option<String>Parent task ID (for subtasks)
blocked_by: Vec<String>IDs of tasks that block this task from being started/completed.
This is modeled as a dependency list (“blocked by”) so we can derive the inverse relationship (“blocks”) on demand.
background_job: Option<TaskBackgroundJob>Optional background job state for tasks that run asynchronously.
sort_order: i32Optional ordering hint for UI dashboards (lower first).
phase: Option<String>Optional phase/group label for UI dashboards.
created_at: DateTime<Utc>When the task was created
updated_at: DateTime<Utc>When the task was last updated
session_id: StringSession ID this task belongs to
source: TaskSourceSource of the task (user, agent, or orchestrator)
orchestrator_task_id: Option<String>ID linking to an orchestrator DelegatedTask (for bidirectional sync)
agent_id: Option<String>ID of the agent that created/owns this task
metadata: Option<Value>Additional metadata (tool calls, output, context, etc.)
Implementations§
Source§impl Task
impl Task
Sourcepub fn new(
session_id: impl Into<String>,
name: impl Into<String>,
description: impl Into<String>,
parent_id: Option<String>,
) -> Self
pub fn new( session_id: impl Into<String>, name: impl Into<String>, description: impl Into<String>, parent_id: Option<String>, ) -> Self
Create a new task (defaults to User source)
Sourcepub fn new_with_source(
session_id: impl Into<String>,
name: impl Into<String>,
description: impl Into<String>,
parent_id: Option<String>,
source: TaskSource,
agent_id: Option<String>,
) -> Self
pub fn new_with_source( session_id: impl Into<String>, name: impl Into<String>, description: impl Into<String>, parent_id: Option<String>, source: TaskSource, agent_id: Option<String>, ) -> Self
Create a new task with a specific source
Sourcepub fn from_orchestrator_task(
session_id: impl Into<String>,
orchestrator_task_id: impl Into<String>,
agent_id: impl Into<String>,
name: impl Into<String>,
description: impl Into<String>,
context: Option<Value>,
) -> Self
pub fn from_orchestrator_task( session_id: impl Into<String>, orchestrator_task_id: impl Into<String>, agent_id: impl Into<String>, name: impl Into<String>, description: impl Into<String>, context: Option<Value>, ) -> Self
Create a task from an orchestrator delegated task
Sourcepub fn set_metadata(&mut self, metadata: Value)
pub fn set_metadata(&mut self, metadata: Value)
Set metadata (e.g., tool calls, output)
Sourcepub fn set_status(&mut self, status: TaskStatus)
pub fn set_status(&mut self, status: TaskStatus)
Update the task status
Sourcepub fn set_description(&mut self, description: impl Into<String>)
pub fn set_description(&mut self, description: impl Into<String>)
Update the task description
Sourcepub fn is_terminal(&self) -> bool
pub fn is_terminal(&self) -> bool
Returns true when the task is in a terminal (non-active) status.
Sourcepub fn set_background_job(&mut self, job: Option<TaskBackgroundJob>)
pub fn set_background_job(&mut self, job: Option<TaskBackgroundJob>)
Replace the background job state and update timestamps.
Sourcepub fn add_blocked_by(&mut self, task_id: impl Into<String>)
pub fn add_blocked_by(&mut self, task_id: impl Into<String>)
Add a dependency (“blocked by”) to this task.
This does not validate existence; callers should validate using the session’s TaskList.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Task
impl<'de> Deserialize<'de> for Task
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 Task
impl RefUnwindSafe for Task
impl Send for Task
impl Sync for Task
impl Unpin for Task
impl UnsafeUnpin for Task
impl UnwindSafe for Task
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].