pub struct LoadedPlugin { /* private fields */ }Expand description
One loaded plug-in. Holds the Library alive for the process lifetime so
the manifest pointer never dangles.
library is wrapped in ManuallyDrop so dropping the LoadedPlugin
(or the owning PluginLoader) does NOT dlclose the cdylib. v1 leaks
the handle intentionally: any manifest, vtable, or drop_fn pointer the
host has copied into its registries must outlive the loader. Unloading
would dangle every such pointer, and a later custom-data drop call would
jump into freed code.
Implementations§
Source§impl LoadedPlugin
impl LoadedPlugin
Sourcepub fn manifest(&self) -> &PluginManifest
pub fn manifest(&self) -> &PluginManifest
Returns the manifest the plug-in published at init time.
Sourcepub fn validated_manifest(&self) -> ValidatedPluginManifest<'static>
pub fn validated_manifest(&self) -> ValidatedPluginManifest<'static>
Returns a host-side manifest view that carries validation invariants.
Trait Implementations§
Source§impl Debug for LoadedPlugin
impl Debug for LoadedPlugin
impl Send for LoadedPlugin
SAFETY: LoadedPlugin only exposes the manifest through &self, and the
manifest is immutable static data inside the loaded library.
impl Sync for LoadedPlugin
SAFETY: see above.
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
Mutably borrows from an owned value. Read more