pub struct PluginLoader { /* private fields */ }Expand description
Plugin Loader
Manages dynamic loading and unloading of Shape plugins. Keeps loaded libraries in memory to prevent unloading while in use.
Implementations§
Source§impl PluginLoader
impl PluginLoader
Sourcepub fn load(&mut self, path: &Path) -> Result<LoadedPlugin>
pub fn load(&mut self, path: &Path) -> Result<LoadedPlugin>
Sourcepub fn get_data_source_vtable(
&self,
name: &str,
) -> Result<&'static DataSourceVTable>
pub fn get_data_source_vtable( &self, name: &str, ) -> Result<&'static DataSourceVTable>
Sourcepub fn get_output_sink_vtable(
&self,
name: &str,
) -> Result<&'static OutputSinkVTable>
pub fn get_output_sink_vtable( &self, name: &str, ) -> Result<&'static OutputSinkVTable>
Sourcepub fn get_module_vtable(&self, name: &str) -> Result<&'static ModuleVTable>
pub fn get_module_vtable(&self, name: &str) -> Result<&'static ModuleVTable>
Get the base module vtable for a loaded plugin.
Sourcepub fn get_language_runtime_vtable(
&self,
name: &str,
) -> Result<&'static LanguageRuntimeVTable>
pub fn get_language_runtime_vtable( &self, name: &str, ) -> Result<&'static LanguageRuntimeVTable>
Get the language runtime vtable for a loaded plugin.
Sourcepub fn unload(&mut self, name: &str) -> bool
pub fn unload(&mut self, name: &str) -> bool
Unload a plugin
Note: The library is actually unloaded when dropped. This removes it from the loader’s tracking.
Sourcepub fn loaded_plugins(&self) -> Vec<&str>
pub fn loaded_plugins(&self) -> Vec<&str>
List all loaded plugins
Sourcepub fn load_data_source(
&mut self,
path: &Path,
config: &Value,
) -> Result<PluginDataSource>
pub fn load_data_source( &mut self, path: &Path, config: &Value, ) -> Result<PluginDataSource>
Load a data source plugin and return a ready-to-use wrapper
This is a convenience method that combines loading the library, getting the vtable, and creating the PluginDataSource wrapper.
§Arguments
path- Path to the shared libraryconfig- Configuration value for the plugin
§Returns
Ready-to-use PluginDataSource wrapper
Trait Implementations§
Source§impl Default for PluginLoader
impl Default for PluginLoader
Auto Trait Implementations§
impl Freeze for PluginLoader
impl RefUnwindSafe for PluginLoader
impl Send for PluginLoader
impl Sync for PluginLoader
impl Unpin for PluginLoader
impl UnsafeUnpin for PluginLoader
impl UnwindSafe for PluginLoader
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
Mutably borrows from an owned value. Read more
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>
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 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>
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