pub trait TransactionObserver: Send + Sync {
// Required methods
fn name(&self) -> &'static str;
fn apply<'life0, 'life1, 'async_trait>(
&'life0 self,
tx_result: &'life1 TransactionResult,
) -> Pin<Box<dyn Future<Output = Result<(), ClientError>> + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
Side-effect-only observer of committed transactions. apply() runs
once per apply_transaction AFTER the standard updates land. Errors
are logged (tagged with Self::name) and never abort sync.
Required Methods§
Sourcefn apply<'life0, 'life1, 'async_trait>(
&'life0 self,
tx_result: &'life1 TransactionResult,
) -> Pin<Box<dyn Future<Output = Result<(), ClientError>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn apply<'life0, 'life1, 'async_trait>(
&'life0 self,
tx_result: &'life1 TransactionResult,
) -> Pin<Box<dyn Future<Output = Result<(), ClientError>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Return Ok(()) for “not interested”; reserve Err(_) for genuine
internal failures.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".