pub struct PluginLibrary { /* private fields */ }Expand description
A loaded dynamic library containing a plugin
Implementations§
Source§impl PluginLibrary
impl PluginLibrary
Sourcepub unsafe fn load<P: AsRef<OsStr>>(path: P) -> Result<Self, DylibError>
pub unsafe fn load<P: AsRef<OsStr>>(path: P) -> Result<Self, DylibError>
Load a plugin from a dynamic library
§Safety
This function is unsafe because it loads a dynamic library and calls functions from it. The caller must ensure that:
- The library path points to a valid dynamic library file
- The library implements the required plugin interface correctly
- The library is compatible with the current platform and architecture
- The library’s create_plugin function returns a valid plugin instance
- The library remains loaded for the lifetime of the returned plugin
Sourcepub fn plugin(&self) -> Arc<dyn VanguardPlugin>
pub fn plugin(&self) -> Arc<dyn VanguardPlugin>
Get a reference to the loaded plugin
Auto Trait Implementations§
impl Freeze for PluginLibrary
impl !RefUnwindSafe for PluginLibrary
impl Send for PluginLibrary
impl Sync for PluginLibrary
impl Unpin for PluginLibrary
impl !UnwindSafe for PluginLibrary
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