Trait query_connector::Transaction
source · pub trait Transaction: ConnectionLike {
// Required methods
fn commit<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn rollback<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn as_connection_like(&mut self) -> &mut dyn ConnectionLike;
}
Required Methods§
fn commit<'life0, 'async_trait>( &'life0 mut self ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
fn rollback<'life0, 'async_trait>( &'life0 mut self ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
sourcefn as_connection_like(&mut self) -> &mut dyn ConnectionLike
fn as_connection_like(&mut self) -> &mut dyn ConnectionLike
Explicit upcast of self reference. Rusts current vtable layout doesn’t allow for an upcast if
trait A
, trait B: A
, so that Box<dyn B> as Box<dyn A>
works. This is a simple, explicit workaround.