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>,
) -> Task
pub fn new( session_id: impl Into<String>, name: impl Into<String>, description: impl Into<String>, parent_id: Option<String>, ) -> Task
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>,
) -> Task
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>, ) -> Task
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>,
) -> Task
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>, ) -> Task
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<Task, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Task, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for Task
impl Serialize for Task
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 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> 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].