pub trait Plugin: Send + Sync {
// Required methods
fn info(&self) -> PluginInfo;
fn as_any(&self) -> &dyn Any;
fn as_any_mut(&mut self) -> &mut dyn Any;
// Provided methods
fn status(&self) -> PluginStatus { ... }
fn init<'life0, 'async_trait>(
&'life0 mut self,
_config: Value,
) -> Pin<Box<dyn Future<Output = PluginResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn ready<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = PluginResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn destroy<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = PluginResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn invoke<'life0, 'life1, 'async_trait>(
&'life0 self,
method: &'life1 str,
_params: Value,
) -> Pin<Box<dyn Future<Output = PluginResult<Value>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
}Expand description
插件 trait
Required Methods§
Sourcefn info(&self) -> PluginInfo
fn info(&self) -> PluginInfo
获取插件信息
fn as_any_mut(&mut self) -> &mut dyn Any
Provided Methods§
Sourcefn status(&self) -> PluginStatus
fn status(&self) -> PluginStatus
获取插件状态
Sourcefn init<'life0, 'async_trait>(
&'life0 mut self,
_config: Value,
) -> Pin<Box<dyn Future<Output = PluginResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn init<'life0, 'async_trait>(
&'life0 mut self,
_config: Value,
) -> Pin<Box<dyn Future<Output = PluginResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
插件初始化
Sourcefn ready<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = PluginResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn ready<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = PluginResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
插件就绪
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".