pub struct Plugin { /* private fields */ }Expand description
A loaded Fusabi plugin.
Implementations§
Source§impl Plugin
impl Plugin
Sourcepub fn info(&self) -> PluginInfo
pub fn info(&self) -> PluginInfo
Get plugin information.
Sourcepub fn state(&self) -> LifecycleState
pub fn state(&self) -> LifecycleState
Get the current lifecycle state.
Sourcepub fn set_state(&self, state: LifecycleState)
pub fn set_state(&self, state: LifecycleState)
Set the lifecycle state.
Sourcepub fn initialize(&self, engine_config: EngineConfig) -> Result<()>
pub fn initialize(&self, engine_config: EngineConfig) -> Result<()>
Initialize the plugin with an engine.
Sourcepub fn call(&self, function: &str, args: &[Value]) -> Result<Value>
pub fn call(&self, function: &str, args: &[Value]) -> Result<Value>
Call a function exported by the plugin.
Sourcepub fn has_export(&self, name: &str) -> bool
pub fn has_export(&self, name: &str) -> bool
Check if the plugin exports a function.
Sourcepub fn requires_capability(&self, cap: &str) -> bool
pub fn requires_capability(&self, cap: &str) -> bool
Check if the plugin requires a capability.
Sourcepub fn set_bytecode(&self, bytecode: Vec<u8>)
pub fn set_bytecode(&self, bytecode: Vec<u8>)
Set the compiled bytecode.
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