Skip to main content

Module scope_stack

Module scope_stack 

Source
Expand description

Scope stack storage and propagation helpers.

The runtime tracks the current scope hierarchy through a shared ScopeStack stored in task-local or thread-local state. Advanced callers can use this module to inspect the active scope chain or propagate scope context into worker threads.

Structs§

PropagationContext
Versioned, transport-neutral causal context for crossing a Relay boundary.
ScopeStack
Mutable stack of active scopes plus their scope-local registries.
ThreadScopeStackBinding
Captured thread-local scope stack binding.

Statics§

TASK_SCOPE_STACK
Task-local scope stack handle used by async execution contexts.

Functions§

capture_propagation_context
Capture the current causal parent without asserting a session root.
capture_propagation_context_with_root
Capture the current causal parent and an application-supplied session root.
capture_thread_scope_stack
Capture the current thread-local scope stack binding.
create_scope_stack
Create a new scope stack handle with an implicit root scope.
create_scope_stack_from_propagation
Create an isolated scope stack rooted below a supplied propagation context.
current_scope_stack
Return the scope stack visible to the current execution context.
fork_scope_stack
Create an isolated scope stack below the current causal parent.
propagate_scope_to_thread
Capture the current scope stack handle for use in another thread.
restore_thread_scope_stack
Restore a previously captured thread-local scope stack binding.
scope_stack_active
Report whether the current context has an explicitly active scope stack.
set_thread_scope_stack
Install an explicit scope stack for the current thread.
sync_thread_scope_stack
Synchronize the thread-local scope stack without marking it explicit.
task_scope_push
Push a scope handle onto the active stack.
task_scope_remove
Remove a scope handle from the active stack.
task_scope_top
Clone the current top-most scope handle from the active stack.
with_active_event_uuid
Run a future with uuid as the causally active managed event.
with_scope_stack
Run a synchronous callback with handle as the visible scope stack.

Type Aliases§

ScopeStackHandle
Shared handle type for the runtime scope stack.