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§
Sourcefn business_transaction(&mut self) -> Option<&mut dyn BusinessTransaction>
fn business_transaction(&mut self) -> Option<&mut dyn BusinessTransaction>
Reborrows an enlisted business transaction when the selected delivery mode supports same-resource atomicity.
Sourcefn commit(
&mut self,
counts: ChunkCounts,
fault: ChunkFaultProgress,
) -> BoxFuture<'_, Result<ChunkCommitReceipt, ChunkTransactionError>>
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.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".