pub struct AnsiTransactionManager { /* private fields */ }
Expand description
An implementation of TransactionManager
which can be used for backends
which use ANSI standard syntax for savepoints such as SQLite and PostgreSQL.
Implementations§
Source§impl AnsiTransactionManager
impl AnsiTransactionManager
Sourcepub fn begin_transaction_sql<Conn>(
conn: &mut Conn,
sql: &str,
) -> QueryResult<()>where
Conn: Connection<TransactionManager = Self>,
pub fn begin_transaction_sql<Conn>(
conn: &mut Conn,
sql: &str,
) -> QueryResult<()>where
Conn: Connection<TransactionManager = Self>,
Begin a transaction with custom SQL
This is used by connections to implement more complex transaction APIs to set things such as isolation levels. Returns an error if already inside of a transaction.
Trait Implementations§
Source§impl Debug for AnsiTransactionManager
impl Debug for AnsiTransactionManager
Source§impl Default for AnsiTransactionManager
impl Default for AnsiTransactionManager
Source§fn default() -> AnsiTransactionManager
fn default() -> AnsiTransactionManager
Returns the “default value” for a type. Read more
Source§impl<Conn> TransactionManager<Conn> for AnsiTransactionManagerwhere
Conn: Connection<TransactionManager = Self>,
impl<Conn> TransactionManager<Conn> for AnsiTransactionManagerwhere
Conn: Connection<TransactionManager = Self>,
Source§fn commit_transaction(conn: &mut Conn) -> QueryResult<()>
fn commit_transaction(conn: &mut Conn) -> QueryResult<()>
If the transaction fails to commit due to a SerializationFailure
or a
ReadOnlyTransaction
a rollback will be attempted. If the rollback succeeds,
the original error will be returned, otherwise the error generated by the rollback
will be returned. In the second case the connection will be considered broken
as it contains a uncommitted unabortable open transaction.
Source§type TransactionStateData = AnsiTransactionManager
type TransactionStateData = AnsiTransactionManager
Data stored as part of the connection implementation
to track the current transaction state of a connection
Source§fn begin_transaction(conn: &mut Conn) -> QueryResult<()>
fn begin_transaction(conn: &mut Conn) -> QueryResult<()>
Begin a new transaction or savepoint Read more
Source§fn rollback_transaction(conn: &mut Conn) -> QueryResult<()>
fn rollback_transaction(conn: &mut Conn) -> QueryResult<()>
Rollback the inner-most transaction or savepoint Read more
Source§fn transaction_manager_status_mut(
conn: &mut Conn,
) -> &mut TransactionManagerStatus
fn transaction_manager_status_mut( conn: &mut Conn, ) -> &mut TransactionManagerStatus
Available on crate feature
i-implement-a-third-party-backend-and-opt-into-breaking-changes
only.Fetch the current transaction status as mutable Read more
Auto Trait Implementations§
impl Freeze for AnsiTransactionManager
impl RefUnwindSafe for AnsiTransactionManager
impl Send for AnsiTransactionManager
impl Sync for AnsiTransactionManager
impl Unpin for AnsiTransactionManager
impl UnwindSafe for AnsiTransactionManager
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.