pub struct RuntimePlugin { /* private fields */ }Expand description
A loaded runtime plugin: its description, where it came from, and the backend that runs it. Keeping any of its capabilities keeps the backend (and a native library) loaded.
Implementations§
Source§impl RuntimePlugin
impl RuntimePlugin
Sourcepub fn new(
abi: PluginAbi,
kind: RuntimeKind,
path: impl Into<PathBuf>,
backend: Arc<dyn AbiBackend>,
) -> Result<Self, LoadError>
pub fn new( abi: PluginAbi, kind: RuntimeKind, path: impl Into<PathBuf>, backend: Arc<dyn AbiBackend>, ) -> Result<Self, LoadError>
Wrap a backend. The description is validated again, so a backend cannot bypass the ABI checks.
Sourcepub fn kind(&self) -> RuntimeKind
pub fn kind(&self) -> RuntimeKind
Native or WASM.
Trait Implementations§
Source§impl Clone for RuntimePlugin
impl Clone for RuntimePlugin
Source§impl Debug for RuntimePlugin
impl Debug for RuntimePlugin
Source§impl Plugin for RuntimePlugin
impl Plugin for RuntimePlugin
Source§fn metadata(&self) -> PluginMetadata
fn metadata(&self) -> PluginMetadata
Who the plugin is. Called before
register.Source§fn register(
&self,
registrar: &mut dyn PluginRegistrar,
) -> Result<(), PluginError>
fn register( &self, registrar: &mut dyn PluginRegistrar, ) -> Result<(), PluginError>
Add capabilities. If this returns an error, the host keeps nothing the
plugin registered.
Auto Trait Implementations§
impl !RefUnwindSafe for RuntimePlugin
impl !UnwindSafe for RuntimePlugin
impl Freeze for RuntimePlugin
impl Send for RuntimePlugin
impl Sync for RuntimePlugin
impl Unpin for RuntimePlugin
impl UnsafeUnpin for RuntimePlugin
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