pub struct Tcb {
pub id: TaskId,
pub parent: Option<TaskId>,
pub state: TaskState,
pub budget: BudgetLedger,
pub wait: Option<WaitReason>,
pub caps: Vec<CompactString>,
pub proc: Option<ProcInfo>,
pub deferred_until: Option<u64>,
}Expand description
One schedulable entity. The root loop and every sub-agent are uniform Tcbs.
Fields§
§id: TaskId§parent: Option<TaskId>§state: TaskState§budget: BudgetLedger§wait: Option<WaitReason>§caps: Vec<CompactString>Capability ids permitted to this task (mirrors AgentProcess.permitted_capability_ids).
proc: Option<ProcInfo>Sub-agent identity for child tasks; None for the root loop.
deferred_until: Option<u64>W2-1: Tasks hitting quota/deferred conditions get a deferred timestamp.
When set, the task is considered Ready-but-deferred until now_ms >= deferred_until.
Implementations§
Source§impl Tcb
impl Tcb
Sourcepub fn root(id: impl Into<TaskId>, budget: SchedulerBudget) -> Self
pub fn root(id: impl Into<TaskId>, budget: SchedulerBudget) -> Self
The root loop task (id 0). M1 constructs this from the runtime task at Start.
Sourcepub fn spawned(manifest: &IsolationManifest, budget: SchedulerBudget) -> Self
pub fn spawned(manifest: &IsolationManifest, budget: SchedulerBudget) -> Self
A sub-agent task spawned under the root, seeded Running, carrying the manifest’s
process identity. The single source of truth for what the AgentProcess view exposes.
Sourcepub fn is_runnable(&self) -> bool
pub fn is_runnable(&self) -> bool
Whether this task is eligible to run now (Ready state + not deferred).
Sourcepub fn is_runnable_at(&self, now_ms: Option<u64>) -> bool
pub fn is_runnable_at(&self, now_ms: Option<u64>) -> bool
Whether this task is eligible to run at a given timestamp.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Tcb
impl RefUnwindSafe for Tcb
impl Send for Tcb
impl Sync for Tcb
impl Unpin for Tcb
impl UnsafeUnpin for Tcb
impl UnwindSafe for Tcb
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