pub trait OutboxTx: Send {
// Required methods
fn enqueue<'a>(
&'a mut self,
entry: OutboxEntry,
) -> Pin<Box<dyn Future<Output = Result<(), DataError>> + Send + 'a>>;
fn commit(
self: Box<Self>,
) -> Pin<Box<dyn Future<Output = Result<(), DataError>> + Send>>;
fn rollback(
self: Box<Self>,
) -> Pin<Box<dyn Future<Output = Result<(), DataError>> + Send>>;
}Expand description
A live database transaction that can also enqueue outbox entries.
Required Methods§
Sourcefn enqueue<'a>(
&'a mut self,
entry: OutboxEntry,
) -> Pin<Box<dyn Future<Output = Result<(), DataError>> + Send + 'a>>
fn enqueue<'a>( &'a mut self, entry: OutboxEntry, ) -> Pin<Box<dyn Future<Output = Result<(), DataError>> + Send + 'a>>
INSERT into the outbox table under THIS transaction — atomic with the business write. Visible to the relay only after commit.
fn commit( self: Box<Self>, ) -> Pin<Box<dyn Future<Output = Result<(), DataError>> + Send>>
fn rollback( self: Box<Self>, ) -> Pin<Box<dyn Future<Output = Result<(), DataError>> + Send>>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".