pub trait TransactionObserver:
Send
+ Sync
+ Debug
+ 'static {
// Required methods
fn name(&self) -> &'static str;
fn requirements(&self) -> ObserverRequirements;
fn on_commit(&self, event: &TransactionEvent<'_>) -> Result<()>;
}Expand description
Trait implemented by every consumer of the post-commit observation surface (audit, replication, etc.).
See module docs for the full contract.
Required Methods§
Sourcefn name(&self) -> &'static str
fn name(&self) -> &'static str
A short identifier for diagnostics and observability — appears
in error logs and metric labels. Conventionally
crate-shortname like "audit" or "replication".
Sourcefn requirements(&self) -> ObserverRequirements
fn requirements(&self) -> ObserverRequirements
Declare which optional TransactionEvent fields this
observer needs the backend to populate. Called once at
registration time; cached by the backend.
Sourcefn on_commit(&self, event: &TransactionEvent<'_>) -> Result<()>
fn on_commit(&self, event: &TransactionEvent<'_>) -> Result<()>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".