pub struct HookChain { /* private fields */ }Expand description
Hook 链 —— 多个 Hook 顺序执行
将多个 Hook 聚合成一个,按注册顺序依次调用。
若任一 Hook 返回 Err,后续 Hook 不再执行。
Implementations§
Trait Implementations§
Source§impl Hook for HookChain
impl Hook for HookChain
Source§fn before_insert<'life0, 'life1, 'async_trait>(
&'life0 self,
row: &'life1 mut Row,
) -> Pin<Box<dyn Future<Output = DbResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn before_insert<'life0, 'life1, 'async_trait>(
&'life0 self,
row: &'life1 mut Row,
) -> Pin<Box<dyn Future<Output = DbResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
INSERT 之前(可修改即将插入的 Row)
Source§fn after_insert<'life0, 'life1, 'async_trait>(
&'life0 self,
row: &'life1 Row,
) -> Pin<Box<dyn Future<Output = DbResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn after_insert<'life0, 'life1, 'async_trait>(
&'life0 self,
row: &'life1 Row,
) -> Pin<Box<dyn Future<Output = DbResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
INSERT 之后(可读取已插入的 Row,不可修改)
Source§fn before_update<'life0, 'life1, 'async_trait>(
&'life0 self,
row: &'life1 mut Row,
) -> Pin<Box<dyn Future<Output = DbResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn before_update<'life0, 'life1, 'async_trait>(
&'life0 self,
row: &'life1 mut Row,
) -> Pin<Box<dyn Future<Output = DbResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
UPDATE 之前(可修改即将更新的 Row)
Source§fn after_update<'life0, 'life1, 'async_trait>(
&'life0 self,
row: &'life1 Row,
) -> Pin<Box<dyn Future<Output = DbResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn after_update<'life0, 'life1, 'async_trait>(
&'life0 self,
row: &'life1 Row,
) -> Pin<Box<dyn Future<Output = DbResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
UPDATE 之后
Auto Trait Implementations§
impl Freeze for HookChain
impl !RefUnwindSafe for HookChain
impl Send for HookChain
impl Sync for HookChain
impl Unpin for HookChain
impl UnsafeUnpin for HookChain
impl !UnwindSafe for HookChain
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> 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