pub struct NullHook;Expand description
空 Hook —— 所有生命周期方法均为空操作
用作未配置 Hook 时的默认实现,避免 Option<Hook> 的额外分支。
Trait Implementations§
Source§impl Hook for NullHook
impl Hook for NullHook
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 NullHook
impl RefUnwindSafe for NullHook
impl Send for NullHook
impl Sync for NullHook
impl Unpin for NullHook
impl UnsafeUnpin for NullHook
impl UnwindSafe for NullHook
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