Expand description
Thread-safe registry of named PolicyConfig instances with lock-free
reads and atomic hot-swap via arc_swap::ArcSwap.
The registry always contains a "standard" policy that matches
PolicyConfig::default(). Additional named policies can be registered
and activated at runtime without dropping frames.
§Example
use ftui_runtime::policy_registry::PolicyRegistry;
use ftui_runtime::policy_config::PolicyConfig;
let registry = PolicyRegistry::new();
// Default active policy is "standard"
assert_eq!(registry.active_name(), "standard");
// Register a custom policy
let mut aggressive = PolicyConfig::default();
aggressive.conformal.alpha = 0.01;
registry.register("aggressive", aggressive);
// Hot-swap
assert!(registry.set_active("aggressive").is_ok());
assert_eq!(registry.active_name(), "aggressive");Structs§
- Policy
Registry - Thread-safe registry of named
PolicyConfiginstances. - Policy
Switch Event - Record emitted when the active policy changes.
Enums§
- Policy
Registry Error - Errors from
PolicyRegistryoperations.
Constants§
- STANDARD_
POLICY - Default policy name, matching
PolicyConfig::default().