Skip to main content

ChunkTransaction

Trait ChunkTransaction 

Source
pub trait ChunkTransaction: Send {
    // Required methods
    fn business_transaction(&mut self) -> Option<&mut dyn BusinessTransaction>;
    fn commit(
        &mut self,
        counts: ChunkCounts,
        fault: ChunkFaultProgress,
    ) -> BoxFuture<'_, Result<ChunkCommitReceipt, ChunkTransactionError>>;
    fn rollback(&mut self) -> BoxFuture<'_, Result<(), ChunkTransactionError>>;
}
Expand description

One adapter-owned transaction for a bounded chunk attempt.

The runtime invokes the writer while this value is open, then commits the supplied checked counters or rolls the transaction back. Implementations keep database-driver and serialization types private.

Required Methods§

Source

fn business_transaction(&mut self) -> Option<&mut dyn BusinessTransaction>

Reborrows an enlisted business transaction when the selected delivery mode supports same-resource atomicity.

Source

fn commit( &mut self, counts: ChunkCounts, fault: ChunkFaultProgress, ) -> BoxFuture<'_, Result<ChunkCommitReceipt, ChunkTransactionError>>

Commits business work and the supplied progress, returning the durable checkpoint and context that became authoritative.

fault carries the skips this chunk accepted. A durable adapter also clears the retained fault state of the superseded checkpoint generation in this transaction, so a skip, its counters, and the checkpoint that makes it authoritative commit or roll back together.

Source

fn rollback(&mut self) -> BoxFuture<'_, Result<(), ChunkTransactionError>>

Rolls back all provisional work in this chunk attempt.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§