Trait PluginTrait

Source
pub trait PluginTrait:
    Send
    + Sync
    + Debug {
    // Provided methods
    fn append_transaction<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        _: &'life1 Transaction,
        _: &'life2 State,
        _: &'life3 State,
    ) -> Pin<Box<dyn Future<Output = Option<Transaction>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: '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 Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait { ... }
    fn before_apply_transaction<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        _tr: &'life1 mut Transaction,
        _state: &'life2 State,
    ) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait { ... }
    fn after_apply_transaction<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        _new_state: &'life1 State,
        _tr: &'life2 mut Transaction,
        _old_state: &'life3 State,
    ) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait { ... }
}
Expand description

插件特征 定义插件的核心行为,包括事务处理和过滤功能

Provided Methods§

Source

fn append_transaction<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, _: &'life1 Transaction, _: &'life2 State, _: &'life3 State, ) -> Pin<Box<dyn Future<Output = Option<Transaction>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

追加事务处理 允许插件在事务执行前修改或扩展事务内容

Source

fn filter_transaction<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _: &'life1 Transaction, _: &'life2 State, ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

事务过滤 决定是否允许事务执行

Source

fn before_apply_transaction<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _tr: &'life1 mut Transaction, _state: &'life2 State, ) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

事务应用前的处理

Source

fn after_apply_transaction<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, _new_state: &'life1 State, _tr: &'life2 mut Transaction, _old_state: &'life3 State, ) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

事务应用后的处理

Implementors§