Skip to main content

ProviderRegistry

Struct ProviderRegistry 

Source
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

Source

pub fn new() -> Self

Create a new empty provider registry

Source

pub fn register(&self, name: &str, provider: SharedAsyncProvider)

Register a provider with a name

§Arguments
  • name - Provider name (e.g., “data”, “api”, “warehouse”)
  • provider - AsyncDataProvider implementation
§Example
registry.register("data", Arc::new(DataFrameAdapter::new(...)));
Source

pub fn get(&self, name: &str) -> Option<SharedAsyncProvider>

Get provider by name

§Arguments
  • name - Provider name to lookup
§Returns

SharedAsyncProvider if found, None otherwise

Source

pub fn set_default(&self, name: &str) -> Result<()>

Set default provider

§Arguments
  • name - Name of provider to use as default
§Errors

Returns error if provider with given name is not registered

Source

pub fn get_default(&self) -> Option<SharedAsyncProvider>

Get default provider

§Returns

SharedAsyncProvider if a default is set, None otherwise

Source

pub fn default_name(&self) -> Option<String>

Get default provider name

Source

pub fn list_providers(&self) -> Vec<String>

List all registered provider names

§Returns

Vector of provider names currently registered

Source

pub fn has_provider(&self, name: &str) -> bool

Check if a provider is registered

Source

pub fn unregister(&self, name: &str) -> bool

Unregister a provider

§Arguments
  • name - Provider name to remove
§Returns

true if provider was removed, false if not found

Source

pub fn clear(&self)

Clear all providers

Source

pub fn load_extension( &self, path: &Path, config: &Value, ) -> Result<LoadedPlugin>

Load an extension module from a shared library

§Arguments
  • path - Path to the extension shared library (.so, .dll, .dylib)
  • config - Configuration value for the extension
§Returns

Information about the loaded extension

§Safety

Loading modules executes arbitrary code. Only load from trusted sources.

Source

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.

Source

pub fn get_language_runtime( &self, language_id: &str, ) -> Option<Arc<PluginLanguageRuntime>>

Get a language runtime by language identifier (e.g., “python”).

Source

pub fn language_runtimes(&self) -> HashMap<String, Arc<PluginLanguageRuntime>>

Return all loaded language runtimes, keyed by language identifier.

Source

pub fn language_runtime_lsp_configs(&self) -> Vec<RuntimeLspConfig>

Return child-LSP configurations declared by loaded language runtimes.

Source

pub fn get_extension(&self, name: &str) -> Option<Arc<PluginDataSource>>

Get an extension data source by name

§Arguments
  • name - Extension name
§Returns

The PluginDataSource if found

Source

pub fn get_extension_module_schema( &self, module_name: &str, ) -> Option<ParsedModuleSchema>

Get extension module schema by module namespace name.

Source

pub fn module_exports_from_extensions(&self) -> Vec<ModuleExports>

Build runtime extension modules from all loaded extension module capabilities.

Source

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.

Source

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.

Source

pub fn get_extension_query_schema( &self, name: &str, ) -> Option<ParsedQuerySchema>

Get query schema for an extension (for LSP autocomplete)

§Arguments
  • name - Extension name
§Returns

The query schema if extension exists

Source

pub fn get_extension_output_schema( &self, name: &str, ) -> Option<ParsedOutputSchema>

Get output schema for an extension (for LSP autocomplete)

§Arguments
  • name - Extension name
§Returns

The output schema if extension exists

Source

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

Source

pub fn list_extensions(&self) -> Vec<String>

List all loaded extension names

Source

pub fn has_extension(&self, name: &str) -> bool

Check if a plugin is loaded

Source

pub fn unload_extension(&self, name: &str) -> bool

Unload an extension

§Arguments
  • name - Extension name to unload
§Returns

true if plugin was unloaded, false if not found

Trait Implementations§

Source§

impl Clone for ProviderRegistry

Source§

fn clone(&self) -> ProviderRegistry

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Default for ProviderRegistry

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,