Expand description
Type-safe context for storing request-scoped data.
This module provides type-erased containers for storing arbitrary data during event processing. Values are stored and retrieved by their Rust type.
§Types
Context- Single-threaded type map (notSend/Sync)RwContext- Thread-safe version wrapped inArc<RwLock<_>>Data- Arc-wrapped shared data for cloneable access
§Example
ⓘ
use evento::context::{RwContext, Data};
// Create a context
let ctx = RwContext::new();
// Store data by type
ctx.insert(Data::new(MyAppState { ... }));
ctx.insert(42u32);
// Retrieve data by type
let state: Data<MyAppState> = ctx.extract();
let number: u32 = ctx.get().unwrap();