pub trait Context: Send + Sync {
// Required methods
fn insert<T: Any + Send + Sync>(&self, value: T);
fn get<T: Any + Send + Sync>(&self) -> Option<Arc<T>>;
fn remove<T: Any + Send + Sync>(&self) -> Option<Arc<T>>;
}Expand description
Shared interface for type-safe, heterogeneous key-value storage.
Both AppContext and RequestContext implement this trait,
allowing generic helper functions to work with either context type.
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.