pub struct Plugin { /* private fields */ }
Expand description
Represents a loaded plugin. It provides the APIs for accessing the plugin.
Implementations§
Source§impl Plugin
impl Plugin
Sourcepub fn mod_names(&self) -> Vec<String>
pub fn mod_names(&self) -> Vec<String>
Returns the names of all module instances in this plugin.
Sourcepub fn mod_instance(&self, name: impl AsRef<str>) -> WasmEdgeResult<Instance>
pub fn mod_instance(&self, name: impl AsRef<str>) -> WasmEdgeResult<Instance>
Returns a plugin module instance that is generated from the module with the given name in this plugin.
§Argument
name
- The name of the target module.
§Error
If failed to return the plugin module instance, then return PluginError::Create error.
Sourcepub unsafe fn as_ptr(&self) -> *const WasmEdge_PluginContext
pub unsafe fn as_ptr(&self) -> *const WasmEdge_PluginContext
§Safety
The lifetime of the returned pointer must not exceed that of the object itself.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Plugin
impl RefUnwindSafe for Plugin
impl Send for Plugin
impl Sync for Plugin
impl Unpin for Plugin
impl UnwindSafe for Plugin
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