pub struct PluginRegistry { /* private fields */ }Expand description
All-surfaces plugin registry.
Per-surface tables wrapped in arc-swap for wait-free reads. The
registry tracks per-plugin ownership so remove_plugin can clean up
all of a plugin’s registrations in one pass.
Implementations§
Source§impl PluginRegistry
impl PluginRegistry
Sourcepub fn scalar_fn(&self, q: &QName) -> Option<Arc<ScalarEntry>>
pub fn scalar_fn(&self, q: &QName) -> Option<Arc<ScalarEntry>>
Look up a registered scalar function by qname.
Sourcepub fn iter_scalars(&self) -> Vec<(QName, Arc<ScalarEntry>)>
pub fn iter_scalars(&self) -> Vec<(QName, Arc<ScalarEntry>)>
Iterate every registered scalar function — (QName, ScalarEntry).
Collects into a Vec so the iteration does not hold a long-lived
reference to the underlying DashMap (avoids subtle aliasing
hazards when callers register or remove plugins mid-iteration).
§Examples
for (qname, entry) in registry.iter_scalars() {
ctx.register_udf(ScalarUDF::new_from_impl(adapt(qname, entry)));
}Sourcepub fn iter_procedures(&self) -> Vec<(QName, Arc<ProcedureEntry>)>
pub fn iter_procedures(&self) -> Vec<(QName, Arc<ProcedureEntry>)>
Iterate every registered procedure — (QName, ProcedureEntry).
Arity-overloaded names yield one tuple per registered overload.
Sourcepub fn iter_locy_aggregates(&self) -> Vec<(QName, Arc<LocyAggregateEntry>)>
pub fn iter_locy_aggregates(&self) -> Vec<(QName, Arc<LocyAggregateEntry>)>
Iterate every registered Locy aggregate — (QName, LocyAggregateEntry).
Sourcepub fn iter_algorithms(&self) -> Vec<(QName, Arc<dyn AlgorithmProvider>)>
pub fn iter_algorithms(&self) -> Vec<(QName, Arc<dyn AlgorithmProvider>)>
Iterate every registered algorithm — (QName, AlgorithmProvider).
Sourcepub fn iter_index_kinds(&self) -> Vec<(IndexKind, Arc<dyn IndexKindProvider>)>
pub fn iter_index_kinds(&self) -> Vec<(IndexKind, Arc<dyn IndexKindProvider>)>
Iterate every registered index kind — (IndexKind, IndexKindProvider).
Sourcepub fn catalogs(&self) -> Vec<Arc<dyn CatalogProvider>>
pub fn catalogs(&self) -> Vec<Arc<dyn CatalogProvider>>
Snapshot the registered catalog providers.
Returns a Vec so the iteration does not hold a long-lived reference
to the underlying DashMap.
Sourcepub fn aggregate(&self, q: &QName) -> Option<Arc<AggregateEntry>>
pub fn aggregate(&self, q: &QName) -> Option<Arc<AggregateEntry>>
Look up a registered aggregate by qname.
Sourcepub fn window(&self, q: &QName) -> Option<Arc<WindowEntry>>
pub fn window(&self, q: &QName) -> Option<Arc<WindowEntry>>
Look up a registered window function by qname.
Sourcepub fn procedure(&self, q: &QName) -> Option<Arc<ProcedureEntry>>
pub fn procedure(&self, q: &QName) -> Option<Arc<ProcedureEntry>>
Look up a registered procedure by qname.
If the qname carries multiple arity overloads (M5c.2), this returns
the first registered entry, which preserves the legacy
single-arity lookup contract. Arity-aware callers should use
Self::procedure_with_arity instead.
Sourcepub fn procedure_with_arity(
&self,
q: &QName,
arity: usize,
) -> Option<Arc<ProcedureEntry>>
pub fn procedure_with_arity( &self, q: &QName, arity: usize, ) -> Option<Arc<ProcedureEntry>>
Look up a registered procedure by qname and positional argument
count. Returns the entry whose signature has exactly arity
arguments, or None if no overload matches.
Procedures may be registered with the same qname under multiple
arities (e.g. an algorithm’s legacy 5-arg form alongside the new
(graphRef, config) 2-arg form). Resolution sites that know the
call’s argument count should prefer this method; the bare
Self::procedure is preserved for callers that only need the
first registration.
Sourcepub fn procedure_overloads(&self, q: &QName) -> Vec<Arc<ProcedureEntry>>
pub fn procedure_overloads(&self, q: &QName) -> Vec<Arc<ProcedureEntry>>
Return all arity overloads registered under q.
The returned Vec is empty when nothing is registered. Useful for
diagnostic surfaces (e.g. EXPLAIN of an ambiguous call) and for
listing API.
Sourcepub fn locy_aggregate(&self, q: &QName) -> Option<Arc<LocyAggregateEntry>>
pub fn locy_aggregate(&self, q: &QName) -> Option<Arc<LocyAggregateEntry>>
Look up a registered Locy aggregate by qname.
Sourcepub fn locy_predicate(&self, q: &QName) -> Option<Arc<LocyPredicateEntry>>
pub fn locy_predicate(&self, q: &QName) -> Option<Arc<LocyPredicateEntry>>
Look up a registered Locy predicate by qname.
Sourcepub fn storage_backend(&self, scheme: &str) -> Option<Arc<dyn StorageBackend>>
pub fn storage_backend(&self, scheme: &str) -> Option<Arc<dyn StorageBackend>>
Look up a registered storage backend by scheme.
Sourcepub fn lookup_label_storage(&self, label: &str) -> Option<Arc<dyn Storage>>
pub fn lookup_label_storage(&self, label: &str) -> Option<Arc<dyn Storage>>
Look up the plugin Storage (if any) registered to serve the
given native label name (M5h.2). Consulted by the host’s
StorageManager::scan_vertex_table before the native backend
fallback — when this returns Some, the planner’s graph-scan
path is routed through plugin storage instead of Lance.
Sourcepub fn index_kind(&self, k: &IndexKind) -> Option<Arc<dyn IndexKindProvider>>
pub fn index_kind(&self, k: &IndexKind) -> Option<Arc<dyn IndexKindProvider>>
Look up a registered index-kind by kind.
Sourcepub fn register_index_handle(
&self,
name: impl Into<SmolStr>,
kind: IndexKind,
handle: Arc<dyn IndexHandle>,
)
pub fn register_index_handle( &self, name: impl Into<SmolStr>, kind: IndexKind, handle: Arc<dyn IndexHandle>, )
Register a live IndexHandle under an index name.
The host calls this after building a handle from a custom
IndexKindProvider (or after open() from persisted bytes). The
planner consults this table from plan_vector_knn to route probes
through the plugin handle instead of the native storage path.
If an entry already exists under the same name, it is replaced.
Sourcepub fn index_handle(&self, name: &str) -> Option<IndexHandleEntry>
pub fn index_handle(&self, name: &str) -> Option<IndexHandleEntry>
Look up a live IndexHandle by index name. Returns a cheap clone
(the inner handle is Arc-wrapped).
Sourcepub fn deregister_index_handle(&self, name: &str) -> Option<IndexHandleEntry>
pub fn deregister_index_handle(&self, name: &str) -> Option<IndexHandleEntry>
Remove a live IndexHandle. Returns the removed entry if one
existed.
Sourcepub fn register_virtual_label(
&self,
name: impl Into<SmolStr>,
table: Arc<dyn CatalogTable>,
) -> Result<u16, PluginError>
pub fn register_virtual_label( &self, name: impl Into<SmolStr>, table: Arc<dyn CatalogTable>, ) -> Result<u16, PluginError>
Allocate (or look up) a virtual label ID for name, owned by
table. The host’s QueryPlanner calls this when an unknown
label name is claimed by a CatalogProvider or
ReplacementScanProvider; subsequent references to the same name
return the cached ID without re-running discovery.
Idempotent: a second call with the same name returns the
previously-allocated ID and replaces the stored CatalogTable
(so cached LogicalPlans naturally pick up the latest table on
next execute). Returns Err if the virtual range is exhausted
(255 slots, see uni_common::core::schema).
Sourcepub fn virtual_label_by_name(&self, name: &str) -> Option<u16>
pub fn virtual_label_by_name(&self, name: &str) -> Option<u16>
Look up a virtual label by name. Returns None if no provider
has claimed it yet (the caller hasn’t called
register_virtual_label).
Sourcepub fn virtual_label_by_id(&self, id: u16) -> Option<VirtualEntry>
pub fn virtual_label_by_id(&self, id: u16) -> Option<VirtualEntry>
Look up the catalog table behind a virtual label ID. Returns the
entry cheaply cloned (inner Arc<dyn CatalogTable>).
Sourcepub fn register_virtual_edge_type(
&self,
name: impl Into<SmolStr>,
table: Arc<dyn CatalogTable>,
) -> Result<u32, PluginError>
pub fn register_virtual_edge_type( &self, name: impl Into<SmolStr>, table: Arc<dyn CatalogTable>, ) -> Result<u32, PluginError>
Allocate (or look up) a virtual edge-type ID for name. Same
semantics as Self::register_virtual_label but for the
u32 edge-type ID space.
Sourcepub fn virtual_edge_type_by_name(&self, name: &str) -> Option<u32>
pub fn virtual_edge_type_by_name(&self, name: &str) -> Option<u32>
Look up a virtual edge type by name.
Sourcepub fn virtual_edge_type_by_id(&self, id: u32) -> Option<VirtualEntry>
pub fn virtual_edge_type_by_id(&self, id: u32) -> Option<VirtualEntry>
Look up the catalog table behind a virtual edge-type ID.
Sourcepub fn algorithm(&self, q: &QName) -> Option<Arc<dyn AlgorithmProvider>>
pub fn algorithm(&self, q: &QName) -> Option<Arc<dyn AlgorithmProvider>>
Look up a registered algorithm by qname.
Sourcepub fn crdt_kind(&self, k: &CrdtKind) -> Option<Arc<dyn CrdtKindProvider>>
pub fn crdt_kind(&self, k: &CrdtKind) -> Option<Arc<dyn CrdtKindProvider>>
Look up a registered CRDT kind.
Sourcepub fn logical_type(
&self,
name: &SmolStr,
) -> Option<Arc<dyn LogicalTypeProvider>>
pub fn logical_type( &self, name: &SmolStr, ) -> Option<Arc<dyn LogicalTypeProvider>>
Look up a registered logical type by its Arrow extension name.
Sourcepub fn optimizer_rules(&self) -> Arc<Vec<Arc<dyn OptimizerRuleProvider>>> ⓘ
pub fn optimizer_rules(&self) -> Arc<Vec<Arc<dyn OptimizerRuleProvider>>> ⓘ
Snapshot the registered optimizer-rule providers (M5h).
Sourcepub fn triggers(&self) -> Arc<Vec<Arc<dyn TriggerPlugin>>> ⓘ
pub fn triggers(&self) -> Arc<Vec<Arc<dyn TriggerPlugin>>> ⓘ
Snapshot the registered trigger chain.
Sourcepub fn cdc_outputs_snapshot(&self) -> Vec<(SmolStr, Arc<dyn CdcOutputProvider>)>
pub fn cdc_outputs_snapshot(&self) -> Vec<(SmolStr, Arc<dyn CdcOutputProvider>)>
Snapshot every registered CdcOutputProvider keyed by name (FU-4).
Used by Uni::build to start a CDC stream per provider before
the commit broadcaster begins pushing CdcBatches.
Sourcepub fn cdc_outputs_is_empty(&self) -> bool
pub fn cdc_outputs_is_empty(&self) -> bool
true when no CdcOutputProvider is registered.
Used by the commit hot-path to skip mutation-row materialization when there are no CDC subscribers — preserves the empty-registry fast path.
Sourcepub fn auth_providers(&self) -> Arc<Vec<Arc<dyn AuthProvider>>> ⓘ
pub fn auth_providers(&self) -> Arc<Vec<Arc<dyn AuthProvider>>> ⓘ
Snapshot the registered authentication providers (M5i).
Sourcepub fn authz_policies(&self) -> Arc<Vec<Arc<dyn AuthzPolicy>>> ⓘ
pub fn authz_policies(&self) -> Arc<Vec<Arc<dyn AuthzPolicy>>> ⓘ
Snapshot the registered authorization policies (M5i).
Sourcepub fn connectors(&self) -> Arc<Vec<Arc<dyn Connector>>> ⓘ
pub fn connectors(&self) -> Arc<Vec<Arc<dyn Connector>>> ⓘ
Snapshot the registered wire-protocol connectors (M5i).
Sourcepub fn replacement_scans(&self) -> Arc<Vec<Arc<dyn ReplacementScanProvider>>> ⓘ
pub fn replacement_scans(&self) -> Arc<Vec<Arc<dyn ReplacementScanProvider>>> ⓘ
Snapshot the registered replacement-scan providers.
Sourcepub fn background_jobs(&self) -> Arc<Vec<Arc<dyn BackgroundJobProvider>>> ⓘ
pub fn background_jobs(&self) -> Arc<Vec<Arc<dyn BackgroundJobProvider>>> ⓘ
Snapshot the registered background jobs.
Sourcepub fn iter_for_plugin(&self, plugin: &PluginId) -> Option<PluginRecordSnapshot>
pub fn iter_for_plugin(&self, plugin: &PluginId) -> Option<PluginRecordSnapshot>
Snapshot the surfaces a plugin currently owns.
Returns None when the plugin has never registered anything (or
has already been removed). Used by
crate::reload::ReloadDispatcher to determine which per-kind
reload protocols to invoke for the old plugin.
The snapshot is a deep clone of the registry’s internal
PluginRecord; mutating the registry afterward does not affect
the snapshot.
Sourcepub fn remove_plugin(&self, plugin: &PluginId)
pub fn remove_plugin(&self, plugin: &PluginId)
Remove all registrations for the given plugin.
Used by Uni::remove_plugin and as part of hot reload’s drain step.
Dispatches per family via the *Ops traits in crate::surfaces;
the label-storage / logical-type / collation / cdc / catalog
surfaces are dropped here too (the per-key tracking lifts the old
count-only gap where hot reload leaked entries on those slots).
Trait Implementations§
Source§impl Debug for PluginRegistry
impl Debug for PluginRegistry
Source§impl Default for PluginRegistry
impl Default for PluginRegistry
Source§fn default() -> PluginRegistry
fn default() -> PluginRegistry
Auto Trait Implementations§
impl !Freeze for PluginRegistry
impl !RefUnwindSafe for PluginRegistry
impl !UnwindSafe for PluginRegistry
impl Send for PluginRegistry
impl Sync for PluginRegistry
impl Unpin for PluginRegistry
impl UnsafeUnpin for PluginRegistry
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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