pub trait FeatureRegistryOps: Sized {
// Required methods
fn new() -> Self;
fn on_load(&mut self, observer: impl Fn(&FeatureRecord) + 'static);
fn load<T>(
&mut self,
loader: &DefaultLoader,
) -> Result<FeatureState<T>, ConfigError>
where T: OptionalSection;
fn validate_dependencies(&self) -> Result<(), ConfigError>;
fn records(&self) -> &[FeatureRecord];
fn summary(&self) -> FeatureSummary;
}Expand description
Startup feature registry: collection, dependency validation, and observation.
Implemented by crate::FeatureRegistry.
Required Methods§
Sourcefn on_load(&mut self, observer: impl Fn(&FeatureRecord) + 'static)
fn on_load(&mut self, observer: impl Fn(&FeatureRecord) + 'static)
Register a callback to observe loaded records.
Sourcefn load<T>(
&mut self,
loader: &DefaultLoader,
) -> Result<FeatureState<T>, ConfigError>where
T: OptionalSection,
fn load<T>(
&mut self,
loader: &DefaultLoader,
) -> Result<FeatureState<T>, ConfigError>where
T: OptionalSection,
Load a feature section and record its state.
§Errors
Propagates any ConfigError returned by the loader.
Sourcefn validate_dependencies(&self) -> Result<(), ConfigError>
fn validate_dependencies(&self) -> Result<(), ConfigError>
Validate that every enabled feature’s declared dependencies are enabled.
§Errors
Returns ConfigError::Validation listing all unsatisfied dependencies.
Sourcefn records(&self) -> &[FeatureRecord]
fn records(&self) -> &[FeatureRecord]
Borrow the recorded feature records.
Sourcefn summary(&self) -> FeatureSummary
fn summary(&self) -> FeatureSummary
Build a point-in-time snapshot of the recorded features.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".