pub struct TransactionalVtabState<S: Clone> { /* private fields */ }Expand description
Snapshot-backed transaction/savepoint state for mutable virtual tables.
Virtual table implementations that keep their authoritative state in memory
can use this helper to participate in connection-level BEGIN/COMMIT/
ROLLBACK and savepoint recovery without wiring their own savepoint stack.
Implementations§
Source§impl<S: Clone> TransactionalVtabState<S>
impl<S: Clone> TransactionalVtabState<S>
Sourcepub fn rollback(&mut self) -> Option<S>
pub fn rollback(&mut self) -> Option<S>
Return the transaction-begin snapshot for a full rollback.
Sourcepub fn savepoint(&mut self, level: i32, snapshot: S)
pub fn savepoint(&mut self, level: i32, snapshot: S)
Record the current state at savepoint level.
Sourcepub fn rollback_to(&mut self, level: i32) -> Option<S>
pub fn rollback_to(&mut self, level: i32) -> Option<S>
Return the snapshot recorded for savepoint level, keeping that
savepoint active and discarding deeper ones.
If the virtual table joined the transaction after outer savepoints were
already active, SQLite only gives it a snapshot for the current level.
Falling back to the transaction-begin snapshot lets ROLLBACK TO an
older savepoint restore the correct pre-transaction state.
Trait Implementations§
Source§impl<S: Clone + Clone> Clone for TransactionalVtabState<S>
impl<S: Clone + Clone> Clone for TransactionalVtabState<S>
Source§fn clone(&self) -> TransactionalVtabState<S>
fn clone(&self) -> TransactionalVtabState<S>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more