pub trait BillingTransaction: Send {
// Required methods
fn connection(&mut self) -> &mut PgConnection;
fn subject_state(&self) -> BillingTransactionSubjectState;
fn append_event<'life0, 'life1, 'async_trait>(
&'life0 mut self,
event: &'life1 BillingEvent,
) -> Pin<Box<dyn Future<Output = Result<(), BillingEventWriteError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn commit<'async_trait>(
self: Box<Self>,
) -> Pin<Box<dyn Future<Output = Result<(), BillingTransactionError>> + Send + 'async_trait>>
where Self: 'async_trait;
fn rollback<'async_trait>(
self: Box<Self>,
) -> Pin<Box<dyn Future<Output = Result<(), BillingTransactionError>> + Send + 'async_trait>>
where Self: 'async_trait;
}Expand description
One host-owned transaction and its typed event projection capability.
The returned connection is the same transaction on which append_event
and commit operate. Implementations must not acquire another connection.
Required Methods§
fn connection(&mut self) -> &mut PgConnection
fn subject_state(&self) -> BillingTransactionSubjectState
fn append_event<'life0, 'life1, 'async_trait>(
&'life0 mut self,
event: &'life1 BillingEvent,
) -> Pin<Box<dyn Future<Output = Result<(), BillingEventWriteError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn commit<'async_trait>(
self: Box<Self>,
) -> Pin<Box<dyn Future<Output = Result<(), BillingTransactionError>> + Send + 'async_trait>>where
Self: 'async_trait,
fn rollback<'async_trait>(
self: Box<Self>,
) -> Pin<Box<dyn Future<Output = Result<(), BillingTransactionError>> + Send + 'async_trait>>where
Self: 'async_trait,
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".