pub struct PluginLoader { /* private fields */ }Expand description
Plugin loader for loading plugins from various sources
Implementations§
Source§impl PluginLoader
impl PluginLoader
pub fn new(registry: Arc<PluginRegistry>) -> Self
Sourcepub fn add_search_path<P: AsRef<Path>>(&mut self, path: P)
pub fn add_search_path<P: AsRef<Path>>(&mut self, path: P)
Add a search path for plugins
Sourcepub fn load_plugin(&mut self, plugin: Arc<dyn AstPlugin>) -> PluginResult
pub fn load_plugin(&mut self, plugin: Arc<dyn AstPlugin>) -> PluginResult
Load plugin from memory (for built-in plugins)
Sourcepub fn load_from_config(
&mut self,
config: &Value,
load_config: &LoadConfig,
) -> PluginResult
pub fn load_from_config( &mut self, config: &Value, load_config: &LoadConfig, ) -> PluginResult
Load plugin from configuration
Sourcepub fn load_plugins(
&mut self,
configs: &[Value],
load_config: &LoadConfig,
) -> Vec<PluginResult>
pub fn load_plugins( &mut self, configs: &[Value], load_config: &LoadConfig, ) -> Vec<PluginResult>
Load multiple plugins with dependency resolution
Sourcepub fn discover_plugins(&self) -> Vec<PathBuf>
pub fn discover_plugins(&self) -> Vec<PathBuf>
Discover plugins in search paths
Sourcepub fn unload_plugin(&mut self, name: &str) -> PluginResult
pub fn unload_plugin(&mut self, name: &str) -> PluginResult
Unload a plugin
Sourcepub fn get_loaded_plugins(&self) -> Vec<LoadedPlugin>
pub fn get_loaded_plugins(&self) -> Vec<LoadedPlugin>
Get information about loaded plugins
Sourcepub fn reload_plugin(
&mut self,
name: &str,
load_config: &LoadConfig,
) -> PluginResult
pub fn reload_plugin( &mut self, name: &str, load_config: &LoadConfig, ) -> PluginResult
Reload a plugin
Sourcepub fn load_from_path(
&mut self,
path: &Path,
load_config: &LoadConfig,
) -> PluginResult
pub fn load_from_path( &mut self, path: &Path, load_config: &LoadConfig, ) -> PluginResult
Load plugin from file path
Auto Trait Implementations§
impl Freeze for PluginLoader
impl RefUnwindSafe for PluginLoader
impl Send for PluginLoader
impl Sync for PluginLoader
impl Unpin for PluginLoader
impl UnwindSafe for PluginLoader
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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