pub struct PluginSpec {
pub state: Option<Arc<dyn StateField>>,
pub key: PluginKey,
pub tr: Option<Arc<dyn PluginTrait>>,
}
Expand description
插件规范结构体 定义插件的配置和行为
Fields§
§state: Option<Arc<dyn StateField>>
§key: PluginKey
§tr: Option<Arc<dyn PluginTrait>>
Implementations§
Source§impl PluginSpec
impl PluginSpec
pub async fn before_apply_transaction( &self, tr: &mut Transaction, state: &State, ) -> Result<(), Box<dyn Error>>
Sourcepub async fn after_apply_transaction(
&self,
new_state: &State,
tr: &mut Transaction,
old_state: &State,
) -> Result<(), Box<dyn Error>>
pub async fn after_apply_transaction( &self, new_state: &State, tr: &mut Transaction, old_state: &State, ) -> Result<(), Box<dyn Error>>
事务应用后的处理
Trait Implementations§
Source§impl Clone for PluginSpec
impl Clone for PluginSpec
Source§fn clone(&self) -> PluginSpec
fn clone(&self) -> PluginSpec
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for PluginSpec
impl !RefUnwindSafe for PluginSpec
impl Send for PluginSpec
impl Sync for PluginSpec
impl Unpin for PluginSpec
impl !UnwindSafe for PluginSpec
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