pub struct PluginRegistryBuilder { /* private fields */ }Expand description
Fluent builder for constructing a PluginRegistry at application startup.
§Example
let registry = PluginRegistryBuilder::new()
.with_dialect("postgres", Arc::new(PostgresDialect))
.with_llm("ollama".into(), Arc::new(OllamaFactory::new()))
.with_auto_discovered()
.build();Implementations§
Source§impl PluginRegistryBuilder
impl PluginRegistryBuilder
Sourcepub fn with_dialect(self, name: &str, dialect: Arc<dyn PlatformDialect>) -> Self
pub fn with_dialect(self, name: &str, dialect: Arc<dyn PlatformDialect>) -> Self
Register a dialect by its canonical string name.
Sourcepub fn with_storage(
self,
platform: StoragePlatform,
factory: Arc<dyn StorageProviderFactory>,
) -> Self
pub fn with_storage( self, platform: StoragePlatform, factory: Arc<dyn StorageProviderFactory>, ) -> Self
Register a storage provider for a known (enum) storage platform.
Sourcepub fn with_storage_extension(
self,
name: String,
factory: Arc<dyn StorageProviderFactory>,
) -> Self
pub fn with_storage_extension( self, name: String, factory: Arc<dyn StorageProviderFactory>, ) -> Self
Register a storage provider for an extension (string-named) platform.
Sourcepub fn with_llm(self, name: String, factory: Arc<dyn LlmClientFactory>) -> Self
pub fn with_llm(self, name: String, factory: Arc<dyn LlmClientFactory>) -> Self
Register an LLM provider factory by name.
Sourcepub fn with_model(self, adapter: Arc<dyn LlmModelAdapter>) -> Self
pub fn with_model(self, adapter: Arc<dyn LlmModelAdapter>) -> Self
Register a model adapter (keyed by provider + model_id).
Sourcepub fn with_language(
self,
language: String,
factory: Arc<dyn LanguageRendererFactory>,
) -> Self
pub fn with_language( self, language: String, factory: Arc<dyn LanguageRendererFactory>, ) -> Self
Register a language renderer factory by language name.
Sourcepub fn with_event_sink(self, sink: Arc<dyn EventSink>) -> Self
pub fn with_event_sink(self, sink: Arc<dyn EventSink>) -> Self
Register an event sink for observability.
Sourcepub fn with_auto_discovered(self) -> Self
pub fn with_auto_discovered(self) -> Self
Discover and register all plugins submitted via inventory::submit!.
Sourcepub fn with_dynamic_plugins(self, plugin_dir: &Path) -> Self
pub fn with_dynamic_plugins(self, plugin_dir: &Path) -> Self
Discover and load all plugin shared libraries from plugin_dir.
Scans the directory for .so/.dylib/.dll files, checks their
API version, and calls their registration function. Invalid or
incompatible plugins are logged and skipped.
Requires the dynamic feature. Native-only: shared-library loading does
not exist on wasm32-unknown-unknown (a browser cannot dlopen .sos).
Sourcepub fn build(self) -> PluginRegistry
pub fn build(self) -> PluginRegistry
Consume the builder and produce the final PluginRegistry.