pub trait Plugin: Send + Sync {
// Required methods
fn name(&self) -> &str;
fn version(&self) -> &str;
fn initialize<'life0, 'life1, 'async_trait>(
&'life0 self,
context: &'life1 PluginContext,
) -> Pin<Box<dyn Future<Output = Layer4Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn execute<'life0, 'life1, 'async_trait>(
&'life0 self,
input: &'life1 Value,
) -> Pin<Box<dyn Future<Output = Layer4Result<Value>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
// Provided methods
fn description(&self) -> &str { ... }
fn dependencies(&self) -> Vec<&str> { ... }
fn shutdown<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Layer4Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
}Expand description
插件接口
Required Methods§
Sourcefn initialize<'life0, 'life1, 'async_trait>(
&'life0 self,
context: &'life1 PluginContext,
) -> Pin<Box<dyn Future<Output = Layer4Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn initialize<'life0, 'life1, 'async_trait>(
&'life0 self,
context: &'life1 PluginContext,
) -> Pin<Box<dyn Future<Output = Layer4Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
初始化插件
Provided Methods§
Sourcefn description(&self) -> &str
fn description(&self) -> &str
插件描述
Sourcefn dependencies(&self) -> Vec<&str>
fn dependencies(&self) -> Vec<&str>
依赖列表
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".