pub struct ModuleRegistry { /* private fields */ }Available on crate feature
alloc only.Expand description
Registry of available module types for instantiation
Implementations§
Source§impl ModuleRegistry
impl ModuleRegistry
Sourcepub fn register_factory<F>(
&mut self,
type_id: &str,
name: &str,
category: &str,
description: &str,
factory: F,
)
pub fn register_factory<F>( &mut self, type_id: &str, name: &str, category: &str, description: &str, factory: F, )
Register a module factory with metadata
Sourcepub fn register_factory_with_keywords<F>(
&mut self,
type_id: &str,
name: &str,
category: &str,
description: &str,
keywords: &[&str],
tags: &[&str],
factory: F,
)
pub fn register_factory_with_keywords<F>( &mut self, type_id: &str, name: &str, category: &str, description: &str, keywords: &[&str], tags: &[&str], factory: F, )
Register a module factory with metadata, keywords, and tags
Sourcepub fn instantiate(
&self,
type_id: &str,
sample_rate: f64,
) -> Option<Box<dyn GraphModule>>
pub fn instantiate( &self, type_id: &str, sample_rate: f64, ) -> Option<Box<dyn GraphModule>>
Instantiate a module by type ID
Sourcepub fn list_modules(&self) -> impl Iterator<Item = &ModuleMetadata>
pub fn list_modules(&self) -> impl Iterator<Item = &ModuleMetadata>
List all registered module types
Sourcepub fn get_metadata(&self, type_id: &str) -> Option<&ModuleMetadata>
pub fn get_metadata(&self, type_id: &str) -> Option<&ModuleMetadata>
Get metadata for a specific module type
Sourcepub fn list_by_category<'a>(
&'a self,
category: &'a str,
) -> impl Iterator<Item = &'a ModuleMetadata>
pub fn list_by_category<'a>( &'a self, category: &'a str, ) -> impl Iterator<Item = &'a ModuleMetadata>
List modules in a specific category
Sourcepub fn categories(&self) -> Vec<String>
pub fn categories(&self) -> Vec<String>
Get all unique categories
Sourcepub fn catalog(&self) -> CatalogResponse
pub fn catalog(&self) -> CatalogResponse
Get the full module catalog for the “add module” UI
Sourcepub fn search(&self, query: &str) -> Vec<ModuleCatalogEntry>
pub fn search(&self, query: &str) -> Vec<ModuleCatalogEntry>
Search modules by query string
Matches against type_id, name, description, and keywords (case-insensitive)
Sourcepub fn by_category(&self, category: &str) -> Vec<ModuleCatalogEntry>
pub fn by_category(&self, category: &str) -> Vec<ModuleCatalogEntry>
Get modules in a specific category
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for ModuleRegistry
impl !UnwindSafe for ModuleRegistry
impl Freeze for ModuleRegistry
impl Send for ModuleRegistry
impl Sync for ModuleRegistry
impl Unpin for ModuleRegistry
impl UnsafeUnpin for ModuleRegistry
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more