Skip to main content

RegistryProvider

Trait RegistryProvider 

Source
pub trait RegistryProvider: Send + Sync {
    // Required methods
    fn list(&self) -> Vec<String>;
    fn get_definition(&self, id: &str) -> Option<Value>;

    // Provided method
    fn get_module_descriptor(&self, id: &str) -> Option<ModuleDescriptor> { ... }
}
Expand description

Unified registry interface used by both discovery commands and the CLI dispatcher. Provides JSON-based access (get_definition) for discovery and typed access (get_module_descriptor) for the dispatch pipeline.

The real apcore::Registry implements this trait via ApCoreRegistryProvider. Tests use MockRegistry.

Required Methods§

Source

fn list(&self) -> Vec<String>

Return all module IDs in the registry.

Source

fn get_definition(&self, id: &str) -> Option<Value>

Return the JSON descriptor for a single module, or None if not found.

Provided Methods§

Source

fn get_module_descriptor(&self, id: &str) -> Option<ModuleDescriptor>

Return the typed descriptor for a single module, or None if not found.

The default implementation deserializes from get_definition. Adapters wrapping a real apcore::Registry should override this for efficiency.

Implementors§