pub struct ProviderRegistry { /* private fields */ }Expand description
Registry of named data providers
Allows registration of multiple providers and selection by name. Thread-safe for use in concurrent contexts.
§Example
let mut registry = ProviderRegistry::new();
// Register market data provider
let md_provider = Arc::new(DataFrameAdapter::new(...));
registry.register("data", md_provider);
// Register an additional provider
let alt_provider = Arc::new(AnotherProvider::new(...));
registry.register("alt", alt_provider);
// Set default
registry.set_default("data")?;
// Get provider by name
let provider = registry.get("data")?;Implementations§
Source§impl ProviderRegistry
impl ProviderRegistry
Sourcepub fn register(&self, name: &str, provider: SharedAsyncProvider)
pub fn register(&self, name: &str, provider: SharedAsyncProvider)
Sourcepub fn get(&self, name: &str) -> Option<SharedAsyncProvider>
pub fn get(&self, name: &str) -> Option<SharedAsyncProvider>
Sourcepub fn set_default(&self, name: &str) -> Result<()>
pub fn set_default(&self, name: &str) -> Result<()>
Sourcepub fn get_default(&self) -> Option<SharedAsyncProvider>
pub fn get_default(&self) -> Option<SharedAsyncProvider>
Sourcepub fn default_name(&self) -> Option<String>
pub fn default_name(&self) -> Option<String>
Get default provider name
Sourcepub fn list_providers(&self) -> Vec<String>
pub fn list_providers(&self) -> Vec<String>
Sourcepub fn has_provider(&self, name: &str) -> bool
pub fn has_provider(&self, name: &str) -> bool
Check if a provider is registered
Sourcepub fn unregister(&self, name: &str) -> bool
pub fn unregister(&self, name: &str) -> bool
Sourcepub fn load_extension(
&self,
path: &Path,
config: &Value,
) -> Result<LoadedPlugin>
pub fn load_extension( &self, path: &Path, config: &Value, ) -> Result<LoadedPlugin>
Sourcepub fn load_extension_with_sections(
&self,
path: &Path,
config: &Value,
extension_sections: &HashMap<String, Value>,
all_claimed: &mut HashSet<String>,
) -> Result<LoadedPlugin>
pub fn load_extension_with_sections( &self, path: &Path, config: &Value, extension_sections: &HashMap<String, Value>, all_claimed: &mut HashSet<String>, ) -> Result<LoadedPlugin>
Load an extension, merging claimed TOML section data into its init config.
For each section claimed by the extension, looks it up in the project’s
extension_sections and merges the data as JSON into the config.
Errors if a required section is missing.
Sourcepub fn get_language_runtime(
&self,
language_id: &str,
) -> Option<Arc<PluginLanguageRuntime>>
pub fn get_language_runtime( &self, language_id: &str, ) -> Option<Arc<PluginLanguageRuntime>>
Get a language runtime by language identifier (e.g., “python”).
Sourcepub fn language_runtimes(&self) -> HashMap<String, Arc<PluginLanguageRuntime>>
pub fn language_runtimes(&self) -> HashMap<String, Arc<PluginLanguageRuntime>>
Return all loaded language runtimes, keyed by language identifier.
Sourcepub fn language_runtime_lsp_configs(&self) -> Vec<RuntimeLspConfig>
pub fn language_runtime_lsp_configs(&self) -> Vec<RuntimeLspConfig>
Return child-LSP configurations declared by loaded language runtimes.
Sourcepub fn get_extension(&self, name: &str) -> Option<Arc<PluginDataSource>>
pub fn get_extension(&self, name: &str) -> Option<Arc<PluginDataSource>>
Sourcepub fn get_extension_module_schema(
&self,
module_name: &str,
) -> Option<ParsedModuleSchema>
pub fn get_extension_module_schema( &self, module_name: &str, ) -> Option<ParsedModuleSchema>
Get extension module schema by module namespace name.
Sourcepub fn module_exports_from_extensions(&self) -> Vec<ModuleExports>
pub fn module_exports_from_extensions(&self) -> Vec<ModuleExports>
Build runtime extension modules from all loaded extension module capabilities.
Sourcepub fn invoke_extension_module_nb(
&self,
module_name: &str,
function: &str,
args: &[ValueWord],
) -> Result<ValueWord>
pub fn invoke_extension_module_nb( &self, module_name: &str, function: &str, args: &[ValueWord], ) -> Result<ValueWord>
Invoke a module-capability export by module namespace and function name.
Sourcepub fn invoke_extension_module_wire(
&self,
module_name: &str,
function: &str,
args: &[WireValue],
) -> Result<WireValue>
pub fn invoke_extension_module_wire( &self, module_name: &str, function: &str, args: &[WireValue], ) -> Result<WireValue>
Invoke a module-capability export by module namespace and function name.
Sourcepub fn get_extension_query_schema(
&self,
name: &str,
) -> Option<ParsedQuerySchema>
pub fn get_extension_query_schema( &self, name: &str, ) -> Option<ParsedQuerySchema>
Sourcepub fn get_extension_output_schema(
&self,
name: &str,
) -> Option<ParsedOutputSchema>
pub fn get_extension_output_schema( &self, name: &str, ) -> Option<ParsedOutputSchema>
Sourcepub fn list_extensions_with_schemas(&self) -> Vec<(String, ParsedQuerySchema)>
pub fn list_extensions_with_schemas(&self) -> Vec<(String, ParsedQuerySchema)>
List all plugins with their query schemas (for LSP)
§Returns
Vector of (plugin_name, query_schema) pairs
Sourcepub fn list_extensions(&self) -> Vec<String>
pub fn list_extensions(&self) -> Vec<String>
List all loaded extension names
Sourcepub fn has_extension(&self, name: &str) -> bool
pub fn has_extension(&self, name: &str) -> bool
Check if a plugin is loaded
Trait Implementations§
Source§impl Clone for ProviderRegistry
impl Clone for ProviderRegistry
Source§fn clone(&self) -> ProviderRegistry
fn clone(&self) -> ProviderRegistry
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for ProviderRegistry
impl RefUnwindSafe for ProviderRegistry
impl Send for ProviderRegistry
impl Sync for ProviderRegistry
impl Unpin for ProviderRegistry
impl UnsafeUnpin for ProviderRegistry
impl UnwindSafe for ProviderRegistry
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more