Struct diesel::connection::AnsiTransactionManager
source · 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
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