pub struct MVCCStorage { /* private fields */ }Expand description
MVCC storage for versioned data
Implementations§
Source§impl MVCCStorage
impl MVCCStorage
Sourcepub fn read(
&self,
key: &[u8],
snapshot_ts: Timestamp,
txn_id: TransactionId,
) -> Result<Option<Vec<u8>>>
pub fn read( &self, key: &[u8], snapshot_ts: Timestamp, txn_id: TransactionId, ) -> Result<Option<Vec<u8>>>
Read a key with MVCC snapshot isolation
Sourcepub fn write(
&self,
key: Vec<u8>,
value: Vec<u8>,
txn_id: TransactionId,
timestamp: Timestamp,
) -> Result<()>
pub fn write( &self, key: Vec<u8>, value: Vec<u8>, txn_id: TransactionId, timestamp: Timestamp, ) -> Result<()>
Write a key (creates a new version)
Sourcepub fn delete(
&self,
key: &[u8],
txn_id: TransactionId,
timestamp: Timestamp,
) -> Result<()>
pub fn delete( &self, key: &[u8], txn_id: TransactionId, timestamp: Timestamp, ) -> Result<()>
Delete a key (creates a delete marker)
Sourcepub fn commit(&self, txn_id: TransactionId) -> Result<()>
pub fn commit(&self, txn_id: TransactionId) -> Result<()>
Commit all versions for a transaction
Sourcepub fn rollback(&self, txn_id: TransactionId) -> Result<()>
pub fn rollback(&self, txn_id: TransactionId) -> Result<()>
Rollback all versions for a transaction
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for MVCCStorage
impl RefUnwindSafe for MVCCStorage
impl Send for MVCCStorage
impl Sync for MVCCStorage
impl Unpin for MVCCStorage
impl UnwindSafe for MVCCStorage
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