pub struct RuntimeContext { /* private fields */ }Implementations§
Source§impl RuntimeContext
impl RuntimeContext
pub fn handle(&self) -> &Handle
pub fn blocking(&self) -> &BlockingExecutor
Sourcepub fn resources(&self) -> &Arc<ResourceLedger> ⓘ
pub fn resources(&self) -> &Arc<ResourceLedger> ⓘ
Aggregate process accountant shared by every VM and trusted subsystem.
pub fn tasks(&self) -> &TaskSupervisor
pub fn metrics(&self) -> &RuntimeMetrics
pub fn max_active_vm_executors(&self) -> usize
pub fn vm_executor_teardown_timeout(&self) -> Duration
pub fn blocking_job_timeout(&self) -> Duration
pub fn fairness(&self) -> &FairWorkBroker
Sourcepub fn allocate_vm_generation(&self) -> Result<u64, RuntimeBuildError>
pub fn allocate_vm_generation(&self) -> Result<u64, RuntimeBuildError>
Allocate an identity in the same process-wide namespace as the shared fairness broker. Every sidecar facade using this runtime must draw from this counter; per-facade counters can collide after an earlier VM retires.
Sourcepub fn vm_generation(&self) -> Option<u64>
pub fn vm_generation(&self) -> Option<u64>
VM generation bound to this admission scope, when this is a VM-scoped context. Fairness keys use this generation rather than a capability’s per-registry generation, which restarts for every VM.
Sourcepub fn terminal_failure(&self) -> Option<TaskTerminalReport>
pub fn terminal_failure(&self) -> Option<TaskTerminalReport>
First failed or panicked task in this process/VM admission scope. This is a durable lifecycle latch, not a drainable telemetry queue.
Sourcepub fn close_admission(&self)
pub fn close_admission(&self)
Permanently close task and blocking-job admission for this context scope and every clone of it. Existing admitted work retains ownership until its normal terminal path releases accounting.
pub fn admission_is_open(&self) -> bool
Sourcepub async fn admission_closed(&self)
pub async fn admission_closed(&self)
Resolve when this admission scope begins teardown.
The notification is armed before checking the atomic flag so a close between observation and await cannot be lost. Each VM-scoped context owns a distinct signal; closing one VM never cancels process or sibling VM work.
Sourcepub fn scoped(&self, resources: Arc<ResourceLedger>) -> Self
pub fn scoped(&self, resources: Arc<ResourceLedger>) -> Self
Create a VM-scoped admission view without creating another runtime, scheduler, queue, or worker.
pub fn scoped_for_vm( &self, resources: Arc<ResourceLedger>, generation: u64, ) -> Self
pub fn spawn<F>( &self, class: TaskClass, future: F, ) -> Result<JoinHandle<F::Output>, TaskSpawnError>
pub fn spawn_result<F, T, E>( &self, class: TaskClass, future: F, ) -> Result<JoinHandle<Result<T, E>>, TaskSpawnError>
Sourcepub fn spawn_owned<F, H>(
&self,
class: TaskClass,
owner: TaskOwner,
on_terminal: H,
future: F,
) -> Result<JoinHandle<F::Output>, TaskSpawnError>
pub fn spawn_owned<F, H>( &self, class: TaskClass, owner: TaskOwner, on_terminal: H, future: F, ) -> Result<JoinHandle<F::Output>, TaskSpawnError>
Spawn work with an explicit lifecycle owner. The terminal hook runs for every exit reason after task accounting is reconciled and outside the supervisor lock, so it can fail/close the owner without lock inversion.
pub fn spawn_owned_result<F, T, E, H>( &self, class: TaskClass, owner: TaskOwner, on_terminal: H, future: F, ) -> Result<JoinHandle<Result<T, E>>, TaskSpawnError>
Trait Implementations§
Source§impl Clone for RuntimeContext
impl Clone for RuntimeContext
Source§fn clone(&self) -> RuntimeContext
fn clone(&self) -> RuntimeContext
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more