Skip to main content

ChunkListener

Trait ChunkListener 

Source
pub trait ChunkListener: Send + Sync {
    // Required methods
    fn before_chunk<'a>(
        &'a self,
        context: ChunkListenerContext<'a>,
    ) -> BoxFuture<'a, Result<(), ChunkListenerError>>;
    fn after_chunk<'a>(
        &'a self,
        context: ChunkListenerContext<'a>,
        outcome: ChunkAttemptOutcome,
    ) -> BoxFuture<'a, Result<(), ChunkListenerError>>;
}
Expand description

Observes a chunk attempt around its transaction body.

Required Methods§

Source

fn before_chunk<'a>( &'a self, context: ChunkListenerContext<'a>, ) -> BoxFuture<'a, Result<(), ChunkListenerError>>

Runs before the transaction begins.

Source

fn after_chunk<'a>( &'a self, context: ChunkListenerContext<'a>, outcome: ChunkAttemptOutcome, ) -> BoxFuture<'a, Result<(), ChunkListenerError>>

Runs after commit, rollback, stop, or an unknown commit result.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§