pub struct PluginLoader { /* private fields */ }Expand description
Plugin loader for loading plugins from manifests and source files.
Implementations§
Source§impl PluginLoader
impl PluginLoader
Sourcepub fn new(config: LoaderConfig) -> Result<Self>
pub fn new(config: LoaderConfig) -> Result<Self>
Create a new plugin loader.
Sourcepub fn config(&self) -> &LoaderConfig
pub fn config(&self) -> &LoaderConfig
Get the loader configuration.
Sourcepub fn load_from_manifest(
&self,
manifest_path: impl AsRef<Path>,
) -> Result<PluginHandle>
pub fn load_from_manifest( &self, manifest_path: impl AsRef<Path>, ) -> Result<PluginHandle>
Load a plugin from a manifest file.
Sourcepub fn load_manifest(
&self,
manifest: Manifest,
manifest_path: Option<PathBuf>,
) -> Result<PluginHandle>
pub fn load_manifest( &self, manifest: Manifest, manifest_path: Option<PathBuf>, ) -> Result<PluginHandle>
Load a plugin from a manifest object.
Sourcepub fn load_source(&self, source_path: impl AsRef<Path>) -> Result<PluginHandle>
pub fn load_source(&self, source_path: impl AsRef<Path>) -> Result<PluginHandle>
Load a plugin from a source file directly.
Sourcepub fn load_bytecode_file(
&self,
bytecode_path: impl AsRef<Path>,
) -> Result<PluginHandle>
pub fn load_bytecode_file( &self, bytecode_path: impl AsRef<Path>, ) -> Result<PluginHandle>
Load a plugin from bytecode directly.
Sourcepub fn reload(&self, plugin: &PluginHandle) -> Result<()>
pub fn reload(&self, plugin: &PluginHandle) -> Result<()>
Reload a plugin.
Trait Implementations§
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<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