pub struct Task {Show 15 fields
pub id: u64,
pub parent_id: Option<u64>,
pub session_id: Option<u64>,
pub agent: CompactString,
pub status: TaskStatus,
pub created_by: CompactString,
pub description: String,
pub result: Option<String>,
pub error: Option<String>,
pub blocked_on: Option<InboxItem>,
pub prompt_tokens: u64,
pub completion_tokens: u64,
pub created_at: Instant,
pub abort_handle: Option<AbortHandle>,
pub status_tx: Sender<TaskStatus>,
}Expand description
A tracked unit of agent work.
Fields§
§id: u64Unique task identifier.
parent_id: Option<u64>Parent task ID for sub-task hierarchy.
session_id: Option<u64>Session allocated for this task’s execution.
agent: CompactStringAgent assigned to this task.
status: TaskStatusCurrent execution status.
created_by: CompactStringOrigin of this task (“user” or agent name).
description: StringHuman-readable task description / message.
result: Option<String>Final result content (set on Finished).
error: Option<String>Error message (set on Failed).
blocked_on: Option<InboxItem>Pending approval item (set when status is Blocked).
prompt_tokens: u64Cumulative prompt tokens used.
completion_tokens: u64Cumulative completion tokens used.
created_at: InstantWhen this task was created.
abort_handle: Option<AbortHandle>Handle to abort the spawned execution task.
status_tx: Sender<TaskStatus>Watch channel for status change notifications (used by await_tasks).
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
Mutably borrows from an owned value. Read more