pub struct D1TransactionManager;Expand description
Refuses every transaction.
D1 does not hold a transaction open across calls, so BEGIN cannot be
followed by anything but its own statement. Buffering writes until
commit would look like a transaction and not be one – reads inside it
would see the database as it was before – which is worse than an error.
So conn.begin() compiles and fails at runtime, and the atomic
multi-statement case goes through D1Connection::execute_batch.
Trait Implementations§
Source§impl Debug for D1TransactionManager
impl Debug for D1TransactionManager
Source§impl TransactionManager for D1TransactionManager
impl TransactionManager for D1TransactionManager
type Database = D1
Source§fn begin(
_conn: &mut D1Connection,
_statement: Option<SqlStr>,
) -> impl Future<Output = Result<(), Error>> + Send + '_
fn begin( _conn: &mut D1Connection, _statement: Option<SqlStr>, ) -> impl Future<Output = Result<(), Error>> + Send + '_
Begin a new transaction or establish a savepoint within the active transaction. Read more
Source§fn commit(
_conn: &mut D1Connection,
) -> impl Future<Output = Result<(), Error>> + Send + '_
fn commit( _conn: &mut D1Connection, ) -> impl Future<Output = Result<(), Error>> + Send + '_
Commit the active transaction or release the most recent savepoint.
Source§fn rollback(
_conn: &mut D1Connection,
) -> impl Future<Output = Result<(), Error>> + Send + '_
fn rollback( _conn: &mut D1Connection, ) -> impl Future<Output = Result<(), Error>> + Send + '_
Abort the active transaction or restore from the most recent savepoint.
Source§fn start_rollback(_conn: &mut D1Connection)
fn start_rollback(_conn: &mut D1Connection)
Starts to abort the active transaction or restore from the most recent snapshot.
Source§fn get_transaction_depth(_conn: &D1Connection) -> usize
fn get_transaction_depth(_conn: &D1Connection) -> usize
Returns the current transaction depth. Read more
Auto Trait Implementations§
impl Freeze for D1TransactionManager
impl RefUnwindSafe for D1TransactionManager
impl Send for D1TransactionManager
impl Sync for D1TransactionManager
impl Unpin for D1TransactionManager
impl UnsafeUnpin for D1TransactionManager
impl UnwindSafe for D1TransactionManager
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more