pub struct Plugin {
pub spec: PluginSpec,
pub key: String,
}
Expand description
插件实例结构体 表示一个具体的插件实例
Fields§
§spec: PluginSpec
§key: String
Implementations§
Source§impl Plugin
impl Plugin
Sourcepub fn new(spec: PluginSpec) -> Plugin
pub fn new(spec: PluginSpec) -> Plugin
创建新的插件实例
Sourcepub fn get_metadata(&self) -> PluginMetadata
pub fn get_metadata(&self) -> PluginMetadata
获取插件元数据
Sourcepub fn get_config(&self) -> PluginConfig
pub fn get_config(&self) -> PluginConfig
获取插件配置
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,
) -> Result<Option<Transaction>, Error>
pub async fn apply_append_transaction( &self, trs: &[Transaction], old_state: &State, new_state: &State, ) -> Result<Option<Transaction>, Error>
应用事务追加逻辑
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Plugin
impl !RefUnwindSafe for Plugin
impl Send for Plugin
impl Sync 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