Expand description
Context management patterns
This module provides thread-safe context management for WASM and native environments. Contexts are used to propagate information across function calls without explicit parameter passing.
§Key Features
- Thread-Local Context: WASM-compatible thread-local storage
- Scoped Context: Automatic context cleanup with RAII
- Context Inheritance: Child contexts inherit from parent contexts
- Type Safety: Strongly typed context values
- Performance: Zero-cost abstractions with compile-time optimization
Structs§
- Context
Key - Context key for type-safe context access
- Global
Context - Global context manager for shared state
- Hash
MapContext - Simple hash map based context manager
- Thread
Local Context - Thread-local context storage
Traits§
- Context
Manager - Context manager trait for different context implementations
Functions§
- clear_
context - Clear all values from the global thread-local context
- get_
context - Get a typed value from the global thread-local context
- remove_
context - Remove a typed value from the global thread-local context
- scoped_
context - Create a scoped context guard for the global thread-local context
- set_
context - Set a typed value in the global thread-local context
- with_
context_ value - Execute a function with a scoped context value