Expand description
§DiagnosticsState Module (ApplicationState)
§RESPONSIBILITIES
Manages diagnostic errors state including markers organized by owner and resource URI. Supports multiple diagnostic owners with their respective marker collections.
§ARCHITECTURAL ROLE
DiagnosticsState is part of the FeatureState module, representing diagnostic errors state.
§KEY COMPONENTS
- DiagnosticsState: Main struct containing diagnostics map
- Default: Initialization implementation
- Helper methods: Diagnostics manipulation utilities
§ERROR HANDLING
- Thread-safe access via
Arc<Mutex<...>> - Proper lock error handling with
MapLockErrorhelpers
§LOGGING
State changes are logged at appropriate levels (debug, info, warn, error).
§PERFORMANCE CONSIDERATIONS
- Lock mutexes briefly and release immediately
- Avoid nested locks to prevent deadlocks
- Use Arc for shared ownership across threads
§TODO
- Add diagnostics validation invariants
- Implement diagnostics change events
- Add diagnostics metrics collection
Structs§
- Diagnostics
State - Diagnostic errors state containing markers by owner and resource.