pub struct Loader<'a, O: Send + Sync, I: Info> { /* private fields */ }
Expand description
Main loader for plugins and managers.
The Loader is the central component of Plux responsible for managing the entire plugin ecosystem. It handles plugin discovery, loading, unloading, and provides the interface for interacting with plugins and managers.
§Type Parameters
'a
- Lifetime parameter for references within the loaderO
- Output type for plugin functions (must implement Send + Sync)I
- Plugin information type (must implement Info trait)
§Fields
managers
- Collection of registered plugin managersregistry
- Registry of functions available to pluginsrequests
- Collection of function requests from the host for pluginsplugins
- Collection of loaded plugins
§Example
use plux_rs::prelude::*;
use plux_custom_manager::CustomManager;
let mut loader = Loader::new();
loader.context(|mut ctx| {
ctx.register_manager(CustomManager::new())?;
// Register functions and requests here
Ok(())
});
Implementations§
Source§impl<'a, O: Send + Sync, I: Info> Loader<'a, O, I>
impl<'a, O: Send + Sync, I: Info> Loader<'a, O, I>
Sourcepub const fn new() -> Self
pub const fn new() -> Self
Creates a new plugin loader instance.
Initializes an empty loader with no managers, plugins, or functions registered.
§Returns
Returns a new Loader instance ready for configuration.
Sourcepub fn context<FO, R>(&mut self, f: FO) -> Rwhere
FO: FnOnce(LoaderContext<'a, '_, O, I>) -> R,
pub fn context<FO, R>(&mut self, f: FO) -> Rwhere
FO: FnOnce(LoaderContext<'a, '_, O, I>) -> R,
Provides access to the loader context for configuration.
This method creates a context that allows registering managers, functions, and requests with the loader. The context ensures proper initialization order and provides a fluent interface for loader setup.
§Parameters
f
- Closure that receives the loader context and returns a result
§Returns
Returns the result of the closure execution.
§Example
use plux_rs::{Loader, StdInfo};
let mut loader = Loader::<'_, (), StdInfo>::new();
loader.context(|mut ctx| {
// Register managers, functions, and requests here
Ok::<(), Box<dyn std::error::Error>>(())
});
Sourcepub fn stop(&mut self) -> Result<(), StopLoaderError>
pub fn stop(&mut self) -> Result<(), StopLoaderError>
Stops the loader and cleans up all resources.
This method unloads all plugins and unregisters all managers in the correct order, ensuring proper cleanup of resources.
§Returns
Returns Result<(), StopLoaderError>
indicating success or failure of the shutdown process.
Sourcepub fn register_manager<M>(
&mut self,
manager: M,
) -> Result<(), RegisterManagerError>where
M: Manager<'a, O, I> + 'static,
pub fn register_manager<M>(
&mut self,
manager: M,
) -> Result<(), RegisterManagerError>where
M: Manager<'a, O, I> + 'static,
Registers a plugin manager with the loader.
This method registers a manager that can handle plugins of a specific format. The manager will be used to load and manage plugins matching its format.
§Parameters
manager
- The manager instance to register
§Returns
Returns Result<(), RegisterManagerError>
indicating success or failure.
Fails if a manager with the same format is already registered.
§Type Parameters
M
- Type of the manager (must implement Manager trait)
Sourcepub unsafe fn forced_register_manager(
&mut self,
manager: Box<dyn Manager<'a, O, I>>,
) -> Result<(), RegisterManagerError>
pub unsafe fn forced_register_manager( &mut self, manager: Box<dyn Manager<'a, O, I>>, ) -> Result<(), RegisterManagerError>
Forcefully registers a plugin manager, bypassing safety checks.
This unsafe method allows registering a manager without checking for format conflicts. Use with caution as it may lead to undefined behavior.
§Parameters
manager
- The manager instance to register
§Returns
Returns Result<(), RegisterManagerError>
indicating success or failure.
§Safety
This method is unsafe because it bypasses format conflict checks that prevent multiple managers from handling the same plugin format.
Sourcepub fn register_managers<M>(
&mut self,
managers: M,
) -> Result<(), RegisterManagerError>
pub fn register_managers<M>( &mut self, managers: M, ) -> Result<(), RegisterManagerError>
Sourcepub fn par_register_managers<M>(
&mut self,
managers: M,
) -> Result<(), RegisterManagerError>
pub fn par_register_managers<M>( &mut self, managers: M, ) -> Result<(), RegisterManagerError>
Registers multiple plugin managers in parallel.
This method registers a collection of managers concurrently using parallel processing. More efficient for large numbers of managers.
§Parameters
managers
- Parallel iterator of manager instances to register
§Returns
Returns Result<(), RegisterManagerError>
indicating success or failure.
Sourcepub fn unregister_manager(
&mut self,
format: &str,
) -> Result<(), UnregisterManagerError>
pub fn unregister_manager( &mut self, format: &str, ) -> Result<(), UnregisterManagerError>
Sourcepub unsafe fn forced_unregister_manager(
&mut self,
index: usize,
) -> Result<(), UnregisterManagerError>
pub unsafe fn forced_unregister_manager( &mut self, index: usize, ) -> Result<(), UnregisterManagerError>
Forcefully unregisters a plugin manager, bypassing safety checks.
This unsafe method allows unregistering a manager without checking if it exists. Use with caution as it may lead to undefined behavior.
§Parameters
index
- Index of the manager to unregister
§Returns
Returns Result<(), UnregisterManagerError>
indicating success or failure.
§Safety
This method is unsafe because it bypasses existence checks that prevent accessing invalid memory or indices.
Sourcepub fn par_get_manager_ref(
&self,
format: &str,
) -> Option<&Box<dyn Manager<'a, O, I>>>
pub fn par_get_manager_ref( &self, format: &str, ) -> Option<&Box<dyn Manager<'a, O, I>>>
Gets an immutable reference to a manager by format (parallel version).
Searches for a registered manager that handles the specified format using parallel processing.
§Parameters
format
- The plugin format to search for (e.g., “lua”, “rs”)
§Returns
Returns Option<&Box<dyn Manager<'a, O, I>>>
containing the manager if found.
Sourcepub fn par_get_manager_mut(
&mut self,
format: &str,
) -> Option<&mut Box<dyn Manager<'a, O, I>>>
pub fn par_get_manager_mut( &mut self, format: &str, ) -> Option<&mut Box<dyn Manager<'a, O, I>>>
Gets a mutable reference to a manager by format (parallel version).
Searches for a registered manager that handles the specified format using parallel processing.
§Parameters
format
- The plugin format to search for (e.g., “lua”, “rs”)
§Returns
Returns Option<&mut Box<dyn Manager<'a, O, I>>>
containing the manager if found.
Sourcepub fn register_plugin(
&mut self,
path: &str,
) -> Result<Bundle, RegisterPluginError>
pub fn register_plugin( &mut self, path: &str, ) -> Result<Bundle, RegisterPluginError>
Registers a plugin with the loader.
This method registers a plugin from the specified path, using the appropriate manager based on the plugin’s format.
§Parameters
path
- Path to the plugin file or directory
§Returns
Returns Result<Bundle, RegisterPluginError>
containing the plugin bundle on success.
Sourcepub unsafe fn forced_register_plugin(
&mut self,
manager: &mut Box<dyn Manager<'a, O, I>>,
plugin_info: PluginInfo<I>,
) -> Result<Bundle, RegisterPluginError>
pub unsafe fn forced_register_plugin( &mut self, manager: &mut Box<dyn Manager<'a, O, I>>, plugin_info: PluginInfo<I>, ) -> Result<Bundle, RegisterPluginError>
Forcefully registers a plugin, bypassing safety checks.
This unsafe method allows registering a plugin without checking for duplicates. Use with caution as it may lead to undefined behavior.
§Parameters
manager
- Reference to the manager that will handle this pluginplugin_info
- Plugin information to register
§Returns
Returns Result<Bundle, RegisterPluginError>
containing the plugin bundle on success.
§Safety
This method is unsafe because it bypasses duplicate checking that prevents multiple plugins with the same ID and version from being registered.
Sourcepub fn register_plugins<'b, P>(
&mut self,
paths: P,
) -> Result<Vec<Bundle>, RegisterPluginError>where
P: IntoIterator<Item = &'b str>,
pub fn register_plugins<'b, P>(
&mut self,
paths: P,
) -> Result<Vec<Bundle>, RegisterPluginError>where
P: IntoIterator<Item = &'b str>,
Registers multiple plugins with the loader.
This method registers multiple plugins from the specified paths in sequence.
§Parameters
paths
- Iterator of paths to plugin files or directories
§Returns
Returns Result<Vec<Bundle>, RegisterPluginError>
containing the plugin bundles on success.
§Type Parameters
'b
- Lifetime of the path referencesP
- Type of the iterator containing path references
Sourcepub fn par_register_plugins<'b, P>(
&mut self,
paths: P,
) -> Result<Vec<Bundle>, RegisterPluginError>where
P: IntoParallelIterator<Item = &'b str>,
pub fn par_register_plugins<'b, P>(
&mut self,
paths: P,
) -> Result<Vec<Bundle>, RegisterPluginError>where
P: IntoParallelIterator<Item = &'b str>,
Registers multiple plugins with the loader in parallel.
This method registers multiple plugins from the specified paths concurrently.
§Parameters
paths
- Parallel iterator of paths to plugin files or directories
§Returns
Returns Result<Vec<Bundle>, RegisterPluginError>
containing the plugin bundles on success.
§Type Parameters
'b
- Lifetime of the path referencesP
- Type of the parallel iterator containing path references
Sourcepub fn unregister_plugin(
&mut self,
id: &str,
version: &Version,
) -> Result<(), UnregisterPluginError>
pub fn unregister_plugin( &mut self, id: &str, version: &Version, ) -> Result<(), UnregisterPluginError>
Sourcepub fn unregister_plugin_by_bundle(
&mut self,
bundle: &Bundle,
) -> Result<(), UnregisterPluginError>
pub fn unregister_plugin_by_bundle( &mut self, bundle: &Bundle, ) -> Result<(), UnregisterPluginError>
Sourcepub fn par_unregister_plugin_by_bundle(
&mut self,
bundle: &Bundle,
) -> Result<(), UnregisterPluginError>
pub fn par_unregister_plugin_by_bundle( &mut self, bundle: &Bundle, ) -> Result<(), UnregisterPluginError>
Unregisters a plugin from the loader by bundle (parallel version).
This method removes a plugin from the loader by bundle information using parallel processing, first unloading it if necessary.
§Parameters
bundle
- Plugin bundle information
§Returns
Returns Result<(), UnregisterPluginError>
indicating success or failure.
Sourcepub unsafe fn forced_unregister_plugin(
&mut self,
index: usize,
) -> Result<(), UnregisterPluginError>
pub unsafe fn forced_unregister_plugin( &mut self, index: usize, ) -> Result<(), UnregisterPluginError>
Forcefully unregisters a plugin, bypassing safety checks.
This unsafe method allows unregistering a plugin without checking if it exists. Use with caution as it may lead to undefined behavior.
§Parameters
index
- Index of the plugin to unregister
§Returns
Returns Result<(), UnregisterPluginError>
indicating success or failure.
§Safety
This method is unsafe because it bypasses existence checks that prevent accessing invalid memory or indices.
Sourcepub fn unload_plugin(
&mut self,
id: &str,
version: &Version,
) -> Result<(), UnloadPluginError>
pub fn unload_plugin( &mut self, id: &str, version: &Version, ) -> Result<(), UnloadPluginError>
Sourcepub fn par_unload_plugin(
&mut self,
id: &str,
version: &Version,
) -> Result<(), UnloadPluginError>
pub fn par_unload_plugin( &mut self, id: &str, version: &Version, ) -> Result<(), UnloadPluginError>
Sourcepub fn unload_plugin_by_bundle(
&mut self,
bundle: &Bundle,
) -> Result<(), UnloadPluginError>
pub fn unload_plugin_by_bundle( &mut self, bundle: &Bundle, ) -> Result<(), UnloadPluginError>
Sourcepub fn par_unload_plugin_by_bundle(
&mut self,
bundle: &Bundle,
) -> Result<(), UnloadPluginError>
pub fn par_unload_plugin_by_bundle( &mut self, bundle: &Bundle, ) -> Result<(), UnloadPluginError>
Sourcepub unsafe fn forced_unload_plugin(
&mut self,
index: usize,
) -> Result<(), UnloadPluginError>
pub unsafe fn forced_unload_plugin( &mut self, index: usize, ) -> Result<(), UnloadPluginError>
Forcefully unloads a plugin, bypassing safety checks.
This unsafe method allows unloading a plugin without checking if it exists. Use with caution as it may lead to undefined behavior.
§Parameters
index
- Index of the plugin to unload
§Returns
Returns Result<(), UnloadPluginError>
indicating success or failure.
§Safety
This method is unsafe because it bypasses existence checks that prevent accessing invalid memory or indices.
Sourcepub fn par_get_plugin(
&self,
id: &str,
version: &Version,
) -> Option<&Plugin<'a, O, I>>
pub fn par_get_plugin( &self, id: &str, version: &Version, ) -> Option<&Plugin<'a, O, I>>
Gets an immutable reference to a plugin by ID and version (parallel version).
Searches for a registered plugin matching the specified ID and version using parallel processing.
§Parameters
id
- Plugin identifierversion
- Plugin version
§Returns
Returns Option<&Plugin<'a, O, I>>
containing the plugin if found.
Sourcepub fn get_plugin_by_bundle(&self, bundle: &Bundle) -> Option<&Plugin<'a, O, I>>
pub fn get_plugin_by_bundle(&self, bundle: &Bundle) -> Option<&Plugin<'a, O, I>>
Sourcepub fn par_get_plugin_by_bundle(
&self,
bundle: &Bundle,
) -> Option<&Plugin<'a, O, I>>
pub fn par_get_plugin_by_bundle( &self, bundle: &Bundle, ) -> Option<&Plugin<'a, O, I>>
Gets an immutable reference to a plugin by bundle (parallel version).
Searches for a registered plugin matching the specified bundle using parallel processing.
§Parameters
bundle
- Plugin bundle containing ID, version, and format
§Returns
Returns Option<&Plugin<'a, O, I>>
containing the plugin if found.
Sourcepub fn get_plugin_mut(
&mut self,
id: &str,
version: &Version,
) -> Option<&mut Plugin<'a, O, I>>
pub fn get_plugin_mut( &mut self, id: &str, version: &Version, ) -> Option<&mut Plugin<'a, O, I>>
Sourcepub fn par_get_plugin_mut(
&mut self,
id: &str,
version: &Version,
) -> Option<&mut Plugin<'a, O, I>>
pub fn par_get_plugin_mut( &mut self, id: &str, version: &Version, ) -> Option<&mut Plugin<'a, O, I>>
Gets a mutable reference to a plugin by ID and version (parallel version).
This method searches for a registered plugin matching the specified ID and version using parallel processing.
§Parameters
id
- Plugin identifierversion
- Plugin version
§Returns
Returns Option<&mut Plugin<'a, O, I>>
containing the plugin if found.
Sourcepub fn get_plugin_mut_by_bundle(
&mut self,
bundle: &Bundle,
) -> Option<&mut Plugin<'a, O, I>>
pub fn get_plugin_mut_by_bundle( &mut self, bundle: &Bundle, ) -> Option<&mut Plugin<'a, O, I>>
Sourcepub fn par_get_plugin_mut_by_bundle(
&mut self,
bundle: &Bundle,
) -> Option<&mut Plugin<'a, O, I>>
pub fn par_get_plugin_mut_by_bundle( &mut self, bundle: &Bundle, ) -> Option<&mut Plugin<'a, O, I>>
Gets a mutable reference to a plugin by bundle (parallel version).
This method searches for a registered plugin matching the specified bundle using parallel processing.
§Parameters
bundle
- Plugin bundle containing ID, version, and format
§Returns
Returns Option<&mut Plugin<'a, O, I>>
containing the plugin if found.
Sourcepub fn get_plugins_by_id(&self, id: &str) -> Vec<&Plugin<'a, O, I>>
pub fn get_plugins_by_id(&self, id: &str) -> Vec<&Plugin<'a, O, I>>
Sourcepub fn par_get_plugins_by_id(&self, id: &str) -> Vec<&Plugin<'a, O, I>>
pub fn par_get_plugins_by_id(&self, id: &str) -> Vec<&Plugin<'a, O, I>>
Sourcepub fn get_plugins_by_id_mut(&mut self, id: &str) -> Vec<&mut Plugin<'a, O, I>>
pub fn get_plugins_by_id_mut(&mut self, id: &str) -> Vec<&mut Plugin<'a, O, I>>
Sourcepub fn par_get_plugins_by_id_mut(
&mut self,
id: &str,
) -> Vec<&mut Plugin<'a, O, I>>
pub fn par_get_plugins_by_id_mut( &mut self, id: &str, ) -> Vec<&mut Plugin<'a, O, I>>
Gets mutable references to all plugins with the specified ID (parallel version).
Returns mutable references to all versions of plugins matching the given ID using parallel processing.
§Parameters
id
- Plugin identifier to search for
§Returns
Returns Vec<&mut Plugin<'a, O, I>>
containing all matching plugins.
Sourcepub const fn get_plugins(&self) -> &Vec<Plugin<'a, O, I>>
pub const fn get_plugins(&self) -> &Vec<Plugin<'a, O, I>>
Gets a reference to all loaded plugins.
Returns the complete list of plugins currently managed by the loader.
§Returns
Returns &Vec<Plugin<'a, O, I>>
containing all loaded plugins.
Sourcepub const fn get_registry(&self) -> &Registry<O>
pub const fn get_registry(&self) -> &Registry<O>
Gets a reference to the function registry.
Returns the registry containing all functions available to plugins.
§Returns
Returns &Registry<O>
containing the function registry.
Sourcepub const fn get_requests(&self) -> &Requests
pub const fn get_requests(&self) -> &Requests
Gets a reference to the function requests.
Returns a set of queries that plugins implement for the host.
§Returns
Returns &Requests
containing the function requests.
Sourcepub fn call_request(
&self,
name: &str,
args: &[Variable],
) -> Result<Vec<O>, PluginCallRequestError>
pub fn call_request( &self, name: &str, args: &[Variable], ) -> Result<Vec<O>, PluginCallRequestError>
Calls a function request across all eligible plugins.
This method calls the specified function request on all plugins that have the highest version for their ID (to avoid calling multiple versions of the same plugin).
§Parameters
name
- Name of the function request to callargs
- Arguments to pass to the function
§Returns
Returns Result<Vec<O>, PluginCallRequestError>
containing results from all
eligible plugins that have the requested function.
Sourcepub fn par_call_request(
&self,
name: &str,
args: &[Variable],
) -> Result<Vec<O>, PluginCallRequestError>
pub fn par_call_request( &self, name: &str, args: &[Variable], ) -> Result<Vec<O>, PluginCallRequestError>
Calls a function request across all eligible plugins (parallel version).
This method calls the specified function request on all plugins that have the highest version for their ID (to avoid calling multiple versions of the same plugin) using parallel processing.
§Parameters
name
- Name of the function request to callargs
- Arguments to pass to the function
§Returns
Returns Result<Vec<O>, PluginCallRequestError>
containing results from all
eligible plugins that have the requested function.
Source§impl<O: Send + Sync, I: Info> Loader<'static, O, I>
impl<O: Send + Sync, I: Info> Loader<'static, O, I>
Sourcepub fn load_plugin(
&mut self,
id: &str,
version: &Version,
) -> Result<(), LoadPluginError>
pub fn load_plugin( &mut self, id: &str, version: &Version, ) -> Result<(), LoadPluginError>
Sourcepub fn par_load_plugin(
&mut self,
id: &str,
version: &Version,
) -> Result<(), LoadPluginError>
pub fn par_load_plugin( &mut self, id: &str, version: &Version, ) -> Result<(), LoadPluginError>
Sourcepub fn load_plugin_by_bundle(
&mut self,
bundle: &Bundle,
) -> Result<(), LoadPluginError>
pub fn load_plugin_by_bundle( &mut self, bundle: &Bundle, ) -> Result<(), LoadPluginError>
Sourcepub fn par_load_plugin_by_bundle(
&mut self,
bundle: &Bundle,
) -> Result<(), LoadPluginError>
pub fn par_load_plugin_by_bundle( &mut self, bundle: &Bundle, ) -> Result<(), LoadPluginError>
Sourcepub unsafe fn forced_load_plugin(
&mut self,
index: usize,
depends: Vec<(Bundle, bool)>,
) -> Result<(), LoadPluginError>
pub unsafe fn forced_load_plugin( &mut self, index: usize, depends: Vec<(Bundle, bool)>, ) -> Result<(), LoadPluginError>
Forcefully loads a plugin, bypassing safety checks.
This unsafe method allows loading a plugin without checking if it exists. Use with caution as it may lead to undefined behavior.
§Parameters
index
- Index of the plugin to loaddepends
- List of dependencies for this plugin
§Returns
Returns Result<(), LoadPluginError>
indicating success or failure.
§Safety
This method is unsafe because it bypasses existence checks that prevent accessing invalid memory or indices.
Sourcepub fn load_plugin_now(
&mut self,
path: &str,
) -> Result<Bundle, PluginOperationError>
pub fn load_plugin_now( &mut self, path: &str, ) -> Result<Bundle, PluginOperationError>
Loads a plugin immediately from the specified path.
This convenience method registers and loads a plugin in a single operation. First registers the plugin, then loads it and all its dependencies.
§Parameters
path
- Path to the plugin file or directory
§Returns
Returns Result<Bundle, PluginOperationError>
containing the plugin bundle on success, or an error from registration or loading.
§Example
use plux_rs::{Loader, StdInfo};
let mut loader = Loader::<'_, (), StdInfo>::new();
// Configure loader with managers...
let bundle = match loader.load_plugin_now("my_plugin-v1.0.0.cst") {
Ok(bundle) => bundle,
Err(e) => return Err(e.into()),
};
println!("Loaded plugin: {}", bundle.id);
Sourcepub fn load_plugins<'b, P>(
&mut self,
paths: P,
) -> Result<Vec<Bundle>, PluginOperationError>where
P: IntoIterator<Item = &'b str>,
pub fn load_plugins<'b, P>(
&mut self,
paths: P,
) -> Result<Vec<Bundle>, PluginOperationError>where
P: IntoIterator<Item = &'b str>,
Loads multiple plugins from the specified paths.
This method registers and loads multiple plugins in sequence.
§Parameters
paths
- Iterator of paths to plugin files or directories
§Returns
Returns Result<Vec<Bundle>, PluginOperationError>
containing the plugin bundles on success, or errors from registration or loading.
§Type Parameters
'b
- Lifetime of the path referencesP
- Type of the iterator containing path references
Sourcepub fn par_load_plugins<'b, P>(
&mut self,
paths: P,
) -> Result<Vec<Bundle>, PluginOperationError>where
P: IntoParallelIterator<Item = &'b str>,
pub fn par_load_plugins<'b, P>(
&mut self,
paths: P,
) -> Result<Vec<Bundle>, PluginOperationError>where
P: IntoParallelIterator<Item = &'b str>,
Loads multiple plugins from the specified paths (parallel version).
This method registers and loads multiple plugins concurrently using parallel processing.
§Parameters
paths
- Parallel iterator of paths to plugin files or directories
§Returns
Returns Result<Vec<Bundle>, PluginOperationError>
containing the plugin bundles on success, or errors from registration or loading.
§Type Parameters
'b
- Lifetime of the path referencesP
- Type of the parallel iterator containing path references
Sourcepub fn load_only_used_plugins<'b, P>(
&mut self,
paths: P,
) -> Result<Vec<Bundle>, PluginOperationError>where
P: IntoIterator<Item = &'b str>,
pub fn load_only_used_plugins<'b, P>(
&mut self,
paths: P,
) -> Result<Vec<Bundle>, PluginOperationError>where
P: IntoIterator<Item = &'b str>,
Loads only the plugins that are used (not dependencies of other plugins).
This method registers and loads only the plugins that are not dependencies of other plugins, and automatically unregisters unused plugins.
§Parameters
paths
- Iterator of paths to plugin files or directories
§Returns
Returns Result<Vec<Bundle>, PluginOperationError>
containing the plugin bundles on success, or errors from registration, unregistration, or loading.
§Type Parameters
'b
- Lifetime of the path referencesP
- Type of the iterator containing path references
Sourcepub fn par_load_only_used_plugins<'b, P>(
&mut self,
paths: P,
) -> Result<Vec<Bundle>, PluginOperationError>where
P: IntoParallelIterator<Item = &'b str>,
pub fn par_load_only_used_plugins<'b, P>(
&mut self,
paths: P,
) -> Result<Vec<Bundle>, PluginOperationError>where
P: IntoParallelIterator<Item = &'b str>,
Loads only the plugins that are used (not dependencies of other plugins) (parallel version).
This method registers and loads only the plugins that are not dependencies of other plugins using parallel processing, and automatically unregisters unused plugins.
§Parameters
paths
- Parallel iterator of paths to plugin files or directories
§Returns
Returns Result<Vec<Bundle>, PluginOperationError>
containing the plugin bundles on success, or errors from registration, unregistration, or loading.
§Type Parameters
'b
- Lifetime of the path referencesP
- Type of the parallel iterator containing path references
Trait Implementations§
Auto Trait Implementations§
impl<'a, O, I> Freeze for Loader<'a, O, I>
impl<'a, O, I> !RefUnwindSafe for Loader<'a, O, I>
impl<'a, O, I> Send for Loader<'a, O, I>
impl<'a, O, I> Sync for Loader<'a, O, I>
impl<'a, O, I> Unpin for Loader<'a, O, I>where
I: Unpin,
impl<'a, O, I> !UnwindSafe for Loader<'a, O, I>
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
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