Expand description
Thread-local dynamic variable binding stack.
binding forms push a frame onto BINDING_STACK for the duration of their
body; the RAII BindingGuard pops it on drop (handles both normal return
and panics).
Structs§
- Binding
Guard - Pops the innermost binding frame when dropped.
Functions§
- capture_
current - Snapshot the current thread’s entire binding stack (for conveyance into a
child thread, e.g.
future). - deref_
var - Check the thread-local stack first (innermost frame wins); fall back to the
root binding stored in the
Varitself. - install_
frames - Install a previously captured snapshot on the current (new) thread.
- is_
thread_ bound - True if
varhas any thread-local binding on this thread. - push_
frame - Push a new dynamic binding frame; return a guard that pops it on drop.
- set_
thread_ local - Set the innermost thread-local binding for
var. Returnsfalseif no thread-local binding exists (caller should fall back to setting the root). - trace_
current - Trace all values in the current thread’s binding stack as GC roots. Call this during the GC root enumeration phase.
- var_
key_ of
Type Aliases§
- VarKey
- Opaque key for a Var in the binding stack (pointer identity). Stable because the GC is non-moving.