pub struct RuntimeHandle { /* private fields */ }Expand description
Cloneable request and diagnostic surface. It exposes no snapshot-map mutators: the snapshot manager is the runtime’s sole publication owner.
Implementations§
Source§impl RuntimeHandle
impl RuntimeHandle
Sourcepub fn funding(&self, now: Timestamp) -> RuntimeFundingReport
pub fn funding(&self, now: Timestamp) -> RuntimeFundingReport
Instance-wide funding estimates at now: lease units in hand, overage
spent and capped, and the earliest lease usability deadline. A
diagnostic read that takes the registry lock; admission never reads
it.
Sourcepub fn begin(
&self,
principal: Principal,
required: PermissionBits,
now: Timestamp,
) -> Result<RequestContext, DenyReason>
pub fn begin( &self, principal: Principal, required: PermissionBits, now: Timestamp, ) -> Result<RequestContext, DenyReason>
Begin staged admission for principal at the caller-supplied now:
one snapshot lookup, the account status check and the route’s
required permission check. Request path: no I/O, no blocking lock
and no clock read (INVARIANTS.md 5). The returned RequestContext
retains the principal’s snapshot generation for the rest of the
request (INVARIANTS.md 26).
§Errors
The DenyReason for an unknown principal, an inactive account, an
expired snapshot or a missing permission, counted in
counters. Nothing is charged.
Sourcepub fn recorder(&self) -> &UsageRecorder
pub fn recorder(&self) -> &UsageRecorder
The usage queue’s request-side handle. Reserve a permit with
UsageRecorder::try_reserve before admitting work, so a full queue
sheds before anything is charged (INVARIANTS.md 8).
Sourcepub fn counters(&self) -> &AdmissionCounters
pub fn counters(&self) -> &AdmissionCounters
What this instance has admitted and refused, per outcome.
Sourcepub fn request_shutdown(&self) -> Instant
pub fn request_shutdown(&self) -> Instant
Start the total deadline and withdraw readiness. Queue closure in the supervisor makes subsequent permit reservations refuse; already issued permits stay valid for draining. Repeated calls never extend the bound.
Sourcepub fn readiness(&self, now: Timestamp) -> RuntimeReadiness
pub fn readiness(&self, now: Timestamp) -> RuntimeReadiness
Whether this instance can admit work at now, with the inputs to that
answer. Serve a readiness probe from
is_ready so no traffic reaches an
instance that would refuse it (INVARIANTS.md 10). Control plane: takes
the registry and observation locks.
Sourcepub fn account_reports(&self, now: Timestamp) -> Vec<AccountReport>
pub fn account_reports(&self, now: Timestamp) -> Vec<AccountReport>
Per-account diagnostics, deliberately separate from metric labels.
Sourcepub fn report(&self) -> RuntimeReport
pub fn report(&self) -> RuntimeReport
Instance-wide counters across accounts, refill, snapshots, accounting, sharding and contention. Control plane: takes the observation and registry locks.