Skip to main content

Tcb

Struct Tcb 

Source
pub struct Tcb {
Show 16 fields pub id: TaskId, pub parent: Option<TaskId>, pub children: BTreeSet<TaskId>, pub state: TaskLifecycle, pub runnable_cause: RunnableCause, pub budget: BudgetLedger, pub wait_set: Option<DurableWaitSet>, pub caps: Vec<CompactString>, pub capabilities: Vec<Capability>, pub proc: Option<ProcInfo>, pub supervision: SupervisionPolicy, pub supervision_events: Vec<SupervisionEvent>, pub detached: bool, pub child_budget_remaining: Option<ResourceBudget>, pub budget_grant: Option<BudgetGrant>, pub mailbox: Mailbox,
}
Expand description

One schedulable entity. The root loop and every sub-agent are uniform Tcbs.

Fields§

§id: TaskId§parent: Option<TaskId>§children: BTreeSet<TaskId>

spc_002: child task ids spawned under this task. Populated by TaskTable insertion (spc_002-05); empty for leaf tasks and for every task predating recursive spawn.

§state: TaskLifecycle§runnable_cause: RunnableCause

Why a Ready child entered the unified local runnable set.

§budget: BudgetLedger§wait_set: Option<DurableWaitSet>

Canonical recoverable wait state.

§caps: Vec<CompactString>

Capability ids permitted to this task (mirrors AgentProcess.permitted_capability_ids).

§capabilities: Vec<Capability>

spc_004 debt closure: this task’s own held Capability grants (spc_004’s resource/ action-scoped shape) — what a spawn from this task may legally attenuate into. Empty by default; only set when IsolationManifest.requested_capabilities (spc_004) was non-empty at spawn time.

§proc: Option<ProcInfo>

Sub-agent identity for child tasks; None for the root loop.

§supervision: SupervisionPolicy

spc_002-07: read by terminate() (spc_008-04) when this task’s own terminal transition commits, to decide what happens to any still-running children.

§supervision_events: Vec<SupervisionEvent>

Durable attempt-level failure history. Logical-task state may continue after a relaunch.

§detached: bool

spc_008-05: when true, this task is exempt from cancel_subtree/cancel_children — it (and its own descendants) are never cancelled as a side effect of an ancestor’s cancellation or termination. false by default (existing behavior unchanged).

§child_budget_remaining: Option<ResourceBudget>

spc_005: this task’s own currently-grantable budget pool for its children — reserve()’s parent_remaining argument. None (the default) means no hierarchical budget is in play on this task, so spawn-time budget checks are skipped entirely and behavior is unchanged from before spc_005.

§budget_grant: Option<BudgetGrant>

spc_005: the grant this task itself received from its parent at spawn time, if the spawner set IsolationManifest.requested_budget. None for the root and for any child spawned without a hierarchical budget request.

§mailbox: Mailbox

spc_006-03: this task’s point-to-point inbox. Empty by default; populated via TaskTable::send_message.

Implementations§

Source§

impl Tcb

Source

pub fn root(id: impl Into<TaskId>, budget: SchedulerBudget) -> Self

The root loop task. Constructed from the runtime task at Start.

Source

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.

Source

pub fn spawned_in( manifest: &IsolationManifest, budget: SchedulerBudget, state: TaskLifecycle, parent: Option<TaskId>, ) -> Self

The same child, seeded in an explicit lifecycle state under an explicit parent.

The acknowledged spawn arc is PendingLaunch → Starting → Running(ack). Callers that have already observed the host launch use Self::spawned; callers that are publishing a launch use this constructor with its explicit lifecycle state.

spc_002-02: parent is no longer hardcoded to root — callers must supply the real caller. This card does not derive that caller from syscall causation (spc_002-04); every call site still passes Some("root") explicitly, preserving today’s behavior byte-for-byte.

Trait Implementations§

Source§

impl Clone for Tcb

Source§

fn clone(&self) -> Tcb

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Tcb

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.