pub struct PluginHost { /* private fields */ }Expand description
Composition point for the process-wide plugin + custom-function registries.
Each plugin crate exposes a register(&mut PluginHost) that adds its
RegisteredPlugin and its custom functions to ONE host; the binary
(e.g. waratah_bin/src/main.rs) then installs the composed host
process-wide EXACTLY ONCE, before any QueryEngine exists. This is the
fix for the first-install-wins trap: two self-installing plugins would
silently drop the second plugin’s registry entries, and the loser would
also have dropped the winner’s custom functions (each map starting from
with_builtins()). Registration-time conflicts — a datatype IRI claimed
by two plugins, a duplicate function IRI — error here, at the composition
site, instead of silently no-op’ing at install time.
Implementations§
Source§impl PluginHost
impl PluginHost
Sourcepub fn registry_is_empty(&self) -> bool
pub fn registry_is_empty(&self) -> bool
Whether any plugin bundle is registered (test / composition checks).
Sourcepub fn register(&mut self, plugin: RegisteredPlugin) -> Result<(), ComputeError>
pub fn register(&mut self, plugin: RegisteredPlugin) -> Result<(), ComputeError>
Merge one plugin bundle into the shared registry. A datatype-IRI
claim conflict with an already-registered plugin errors here
(PluginRegistry::register).
Sourcepub fn register_functions(
&mut self,
functions: Vec<CustomFunction>,
) -> Result<(), ComputeError>
pub fn register_functions( &mut self, functions: Vec<CustomFunction>, ) -> Result<(), ComputeError>
Add custom functions to the ONE shared map (the builtin XSD casts are
already on it). Duplicate IRIs error (CustomFunctions::register).
Sourcepub fn install_process_wide(self)
pub fn install_process_wide(self)
Set BOTH process-wide registries from the composed host.
Builtins + every registered plugin’s functions live on one map: the
engine’s own install is a no-op once this landed first (first install
wins, both are correct registries). The underlying setters keep their
first-wins semantics — a second install is a silent no-op — so this
must be the process’s ONLY host install, and it must happen BEFORE
any QueryEngine is constructed (the engine would otherwise install
plain builtins on the custom-function map, after which plugin
functions can never land).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PluginHost
impl !RefUnwindSafe for PluginHost
impl Send for PluginHost
impl Sync for PluginHost
impl Unpin for PluginHost
impl UnsafeUnpin for PluginHost
impl !UnwindSafe for PluginHost
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<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].