pub struct LoadedPlugin {
pub path: PathBuf,
/* private fields */
}Expand description
A dynamically loaded plugin and its backing library handle.
The library must outlive the plugin — Drop calls the destroy function
before the library is unloaded.
Fields§
§path: PathBufPath to the shared library (for diagnostics).
Implementations§
Source§impl LoadedPlugin
impl LoadedPlugin
Sourcepub unsafe fn into_boxed_plugin(self) -> Box<dyn Plugin>
pub unsafe fn into_boxed_plugin(self) -> Box<dyn Plugin>
Consume this wrapper and return the boxed plugin trait object.
The caller takes ownership of the plugin and is responsible for ensuring the library outlives it. The destroy function will NOT be called — the caller must arrange cleanup.
§Safety
The returned Box<dyn Plugin> references vtable entries inside the
shared library. The library (_library field) is dropped when this
struct is consumed, so the caller must ensure the plugin is dropped
before the library would be unloaded. In practice, this is safe when
the plugin is registered into the PluginRegistry and the registry
is dropped before process exit (which is the normal lifecycle).
Trait Implementations§
Source§impl Debug for LoadedPlugin
impl Debug for LoadedPlugin
Source§impl Drop for LoadedPlugin
impl Drop for LoadedPlugin
impl Send for LoadedPlugin
impl Sync for LoadedPlugin
Auto Trait Implementations§
impl Freeze for LoadedPlugin
impl !RefUnwindSafe for LoadedPlugin
impl Unpin for LoadedPlugin
impl UnsafeUnpin for LoadedPlugin
impl !UnwindSafe for LoadedPlugin
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> 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>
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