silk.concurrency.ambient_table.

Storage shared by lexical providers and captured executions.

Import as AmbientTable with import silk.concurrency.ambient_table { AmbientTable }.

Public declarations: 2.

TraceContext#

silk
pub struct TraceContext

The active span and its execution-local record.

Field traceHigh#

silk
pub traceHigh: u64

High half of the trace identifier.

Field traceLow#

silk
pub traceLow: u64

Low half of the trace identifier.

Field span#

silk
pub span: u64

The current span identifier.

Field flags#

silk
pub flags: u64

Sampling flags and local span depth.

Field owner#

silk
pub owner: u64

Identifies the recorder that owns the current span.

Field record#

silk
pub record: u64

The local open record address, or zero for an inherited span.

AmbientTable#

silk
pub struct AmbientTable

The ambient dispatcher indexes the leading array. The active execution owns the context.

Field entries#

silk
pub entries: [?*const u8; Intrinsic.ambientCount()]

Indexed provider handles consumed by ambient dispatch.

Field context#

silk
pub context: TraceContext

The context inherited by executions created under this table.

Implementation Copy for TraceContext#

silk
impl Copy for TraceContext

Implementation Copy for AmbientTable#

silk
impl Copy for AmbientTable

Implementation TraceContext#

silk
impl TraceContext

Associated function empty#

silk
pub fn empty() -> Self

An execution with no open span has zero identifiers and no recorder.

Associated function tableAddress#

silk
pub fn tableAddress() -> usize

Identifies the installed table across a suspension, or zero outside an ambient scope.

Associated function read#

silk
pub fn read() -> Self

Copies all six words from the installed execution. Returns an empty context outside a provider.

Associated function mayClose#

silk
pub fn mayClose(previous: &Self, table: usize, owner: u64, span: u64, record: u64) -> bool

Checks that a span closes in its opening table and in reverse nesting order. Returns false when no table was installed or an inactive guard left its original scope.

Associated function install#

silk
pub unsafe fn install(context: &Self) -> ()

Replaces the context of the current execution while its ambient table is installed.

Safety#

The caller must own this execution's context. A nonzero record must still belong to the recorder and execution that opened it. A saved context can only be restored to that scope.

Profiles: aarch64-apple-darwin, aarch64-unknown-linux-gnu, aarch64-unknown-linux-gnu-no-libc, x86_64-unknown-linux-gnu, x86_64-unknown-linux-gnu-no-libc, wasm32-unknown-unknown, wasm32-wasip1, wasm32-wasip2, x86_64-pc-windows-msvc, wasm64-unknown-unknown.

View the source of this page