pub struct Plugin {
pub spec: PluginSpec,
pub key: String,
}Expand description
插件实例结构体 表示一个具体的插件实例
Fields§
§spec: PluginSpec§key: StringImplementations§
Source§impl Plugin
impl Plugin
Sourcepub fn new(spec: PluginSpec) -> Self
pub fn new(spec: PluginSpec) -> Self
创建新的插件实例
Sourcepub async fn apply_filter_transaction(
&self,
tr: &Transaction,
state: &State,
) -> bool
pub async fn apply_filter_transaction( &self, tr: &Transaction, state: &State, ) -> bool
应用事务过滤逻辑
Sourcepub async fn apply_append_transaction(
&self,
trs: &[Transaction],
old_state: &State,
new_state: &State,
) -> StateResult<Option<Transaction>>
pub async fn apply_append_transaction( &self, trs: &[Transaction], old_state: &State, new_state: &State, ) -> StateResult<Option<Transaction>>
应用事务追加逻辑
Trait Implementations§
impl Send for Plugin
impl Sync for Plugin
Auto Trait Implementations§
impl Freeze for Plugin
impl !RefUnwindSafe for Plugin
impl Unpin for Plugin
impl !UnwindSafe for Plugin
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more