pub trait PluginTrait:
Send
+ Sync
+ Debug {
// Provided methods
fn metadata(&self) -> PluginMetadata { ... }
fn config(&self) -> PluginConfig { ... }
fn append_transaction<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_: &'life1 [Transaction],
_: &'life2 State,
_: &'life3 State,
) -> Pin<Box<dyn Future<Output = Result<Option<Transaction>, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Self: 'async_trait { ... }
fn filter_transaction<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_: &'life1 Transaction,
_: &'life2 State,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait { ... }
}
Expand description
插件特征 定义插件的核心行为,包括事务处理和过滤功能
Provided Methods§
Sourcefn metadata(&self) -> PluginMetadata
fn metadata(&self) -> PluginMetadata
获取插件元数据(静态信息)- 提供默认实现
Sourcefn config(&self) -> PluginConfig
fn config(&self) -> PluginConfig
获取插件配置(静态配置)- 提供默认实现
Sourcefn append_transaction<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_: &'life1 [Transaction],
_: &'life2 State,
_: &'life3 State,
) -> Pin<Box<dyn Future<Output = Result<Option<Transaction>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Self: 'async_trait,
fn append_transaction<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_: &'life1 [Transaction],
_: &'life2 State,
_: &'life3 State,
) -> Pin<Box<dyn Future<Output = Result<Option<Transaction>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Self: 'async_trait,
追加事务处理 允许插件在事务执行前修改或扩展事务内容
Sourcefn filter_transaction<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_: &'life1 Transaction,
_: &'life2 State,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn filter_transaction<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_: &'life1 Transaction,
_: &'life2 State,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
事务过滤 决定是否允许事务执行