pub struct StackDiscovery { /* private fields */ }Expand description
Dynamic discovery of Sovereign AI Stack components.
Eliminates hardcoded lists (Batuta Review §2.2) by parsing Cargo.toml at runtime to detect available integrations.
Implementations§
Source§impl StackDiscovery
impl StackDiscovery
Sourcepub fn from_cargo_toml(path: &Path) -> SimResult<Self>
pub fn from_cargo_toml(path: &Path) -> SimResult<Self>
Discover available stack components from a Cargo.toml file.
§Errors
Returns an error if the file cannot be read or parsed.
Sourcepub fn from_toml_str(content: &str) -> SimResult<Self>
pub fn from_toml_str(content: &str) -> SimResult<Self>
Discover available stack components from TOML content.
§Errors
Returns an error if the TOML cannot be parsed.
Sourcepub fn parse_stack_component(name: &str) -> Option<StackComponent>
pub fn parse_stack_component(name: &str) -> Option<StackComponent>
Parse component name with fuzzy matching.
Handles both hyphenated and underscored variants.
Sourcepub fn has(&self, component: StackComponent) -> bool
pub fn has(&self, component: StackComponent) -> bool
Check if a component is available.
Sourcepub fn version(&self, component: StackComponent) -> Option<&Version>
pub fn version(&self, component: StackComponent) -> Option<&Version>
Get component version if available.
Sourcepub fn discovered(&self) -> &HashMap<StackComponent, Version>
pub fn discovered(&self) -> &HashMap<StackComponent, Version>
Get all discovered components.
Sourcepub fn register(&mut self, component: StackComponent, version: Version)
pub fn register(&mut self, component: StackComponent, version: Version)
Manually register a component (for testing or manual configuration).
Sourcepub fn check_version(
&self,
component: StackComponent,
min_version: &Version,
) -> bool
pub fn check_version( &self, component: StackComponent, min_version: &Version, ) -> bool
Check version compatibility for a component.
Returns true if the component is available and satisfies
the minimum version requirement.
Trait Implementations§
Source§impl Clone for StackDiscovery
impl Clone for StackDiscovery
Source§fn clone(&self) -> StackDiscovery
fn clone(&self) -> StackDiscovery
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more