pub trait Plugin: Send + Sync {
// Required methods
fn id(&self) -> &str;
fn name(&self) -> &str;
fn version(&self) -> &str;
fn hooks(&self) -> &[PluginHook];
fn execute_hook<'life0, 'async_trait>(
&'life0 self,
hook: PluginHook,
data: Value,
) -> Pin<Box<dyn Future<Output = Result<Value, PluginError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn activate<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), PluginError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn deactivate<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), PluginError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Plugin trait.
Required Methods§
Sourcefn hooks(&self) -> &[PluginHook]
fn hooks(&self) -> &[PluginHook]
Supported hooks.
Sourcefn execute_hook<'life0, 'async_trait>(
&'life0 self,
hook: PluginHook,
data: Value,
) -> Pin<Box<dyn Future<Output = Result<Value, PluginError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn execute_hook<'life0, 'async_trait>(
&'life0 self,
hook: PluginHook,
data: Value,
) -> Pin<Box<dyn Future<Output = Result<Value, PluginError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Execute a hook.
Sourcefn activate<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), PluginError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn activate<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), PluginError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Activate the plugin.
Sourcefn deactivate<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), PluginError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn deactivate<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), PluginError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Deactivate the plugin.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
impl Plugin for NativePlugin
impl Plugin for TsPluginBridge
Implement the Plugin trait so the bridge can be registered.