pub struct TxRwImpl<'tx> { /* private fields */ }
Expand description
Read/Write Transaction
Trait Implementations§
Source§impl<'tx: 'a, 'a> IntoIterator for &'a TxRwImpl<'tx>
impl<'tx: 'a, 'a> IntoIterator for &'a TxRwImpl<'tx>
Source§impl<'tx: 'a, 'a> IntoIterator for &'a mut TxRwImpl<'tx>
impl<'tx: 'a, 'a> IntoIterator for &'a mut TxRwImpl<'tx>
Source§impl<'tx> TxApi<'tx> for TxRwImpl<'tx>
impl<'tx> TxApi<'tx> for TxRwImpl<'tx>
Source§fn size(&self) -> u64
fn size(&self) -> u64
Returns current database size in bytes as seen by this transaction. Read more
Source§fn writable(&self) -> bool
fn writable(&self) -> bool
Returns whether the transaction can perform write operations. Read more
Source§fn cursor<'a>(&'a self) -> CursorImpl<'tx, 'a>
fn cursor<'a>(&'a self) -> CursorImpl<'tx, 'a>
Creates a cursor associated with the root bucket.
All items in the cursor will return None value because all root bucket keys point to buckets. Read more
Source§fn bucket<'a, T: AsRef<[u8]>>(&'a self, name: T) -> Option<BucketImpl<'tx, 'a>>
fn bucket<'a, T: AsRef<[u8]>>(&'a self, name: T) -> Option<BucketImpl<'tx, 'a>>
Retrieves a bucket by name.
Returns None if the bucket does not exist. Read more
fn bucket_path<'a, T: AsRef<[u8]>>( &'a self, names: &[T], ) -> Option<BucketImpl<'tx, 'a>>
Source§fn for_each<'a, F: FnMut(&'a [u8], BucketImpl<'tx, 'a>) -> Result<()>>(
&self,
f: F,
) -> Result<()>where
'tx: 'a,
fn for_each<'a, F: FnMut(&'a [u8], BucketImpl<'tx, 'a>) -> Result<()>>(
&self,
f: F,
) -> Result<()>where
'tx: 'a,
👎Deprecated since 1.3.9: please use
iter_*
methods insteadExecutes a function for each key/value pair in a bucket.
Because ForEach uses a Cursor, the iteration over keys is in lexicographical order. Read more
Source§fn page(&self, id: PgId) -> Option<PageInfo>
fn page(&self, id: PgId) -> Option<PageInfo>
Returns page information for a given page number. Read more
fn iter_buckets<'a>(&'a self) -> BucketIter<'tx, 'a> ⓘ
Source§impl<'tx> TxRwRefApi<'tx> for TxRwImpl<'tx>
impl<'tx> TxRwRefApi<'tx> for TxRwImpl<'tx>
Source§fn bucket_mut<'a, T: AsRef<[u8]>>(
&'a mut self,
name: T,
) -> Option<BucketRwImpl<'tx, 'a>>
fn bucket_mut<'a, T: AsRef<[u8]>>( &'a mut self, name: T, ) -> Option<BucketRwImpl<'tx, 'a>>
Retrieves a mutable bucket by name. Read more
fn bucket_mut_path<'a, T: AsRef<[u8]>>( &'a mut self, names: &[T], ) -> Option<BucketRwImpl<'tx, 'a>>
Source§fn create_bucket<'a, T: AsRef<[u8]>>(
&'a mut self,
name: T,
) -> Result<BucketRwImpl<'tx, 'a>>
fn create_bucket<'a, T: AsRef<[u8]>>( &'a mut self, name: T, ) -> Result<BucketRwImpl<'tx, 'a>>
Creates a new bucket. Read more
Source§fn create_bucket_if_not_exists<'a, T: AsRef<[u8]>>(
&'a mut self,
name: T,
) -> Result<BucketRwImpl<'tx, 'a>>
fn create_bucket_if_not_exists<'a, T: AsRef<[u8]>>( &'a mut self, name: T, ) -> Result<BucketRwImpl<'tx, 'a>>
Creates a new bucket if it doesn’t already exist. Read more
fn create_bucket_path<'a, T: AsRef<[u8]>>( &'a mut self, names: &[T], ) -> Result<BucketRwImpl<'tx, 'a>>
Source§fn delete_bucket<T: AsRef<[u8]>>(&mut self, name: T) -> Result<()>
fn delete_bucket<T: AsRef<[u8]>>(&mut self, name: T) -> Result<()>
DeleteBucket deletes a bucket.
Returns an error if the bucket cannot be found or if the key represents a non-bucket value. Read more
Source§fn on_commit<F: FnOnce() + 'tx>(&mut self, f: F)
fn on_commit<F: FnOnce() + 'tx>(&mut self, f: F)
OnCommit adds a handler function to be executed after the transaction successfully commits. Read more
fn iter_mut_buckets<'a>(&'a mut self) -> BucketIterMut<'tx, 'a> ⓘ
Auto Trait Implementations§
impl<'tx> Freeze for TxRwImpl<'tx>
impl<'tx> !RefUnwindSafe for TxRwImpl<'tx>
impl<'tx> !Send for TxRwImpl<'tx>
impl<'tx> !Sync for TxRwImpl<'tx>
impl<'tx> Unpin for TxRwImpl<'tx>
impl<'tx> !UnwindSafe for TxRwImpl<'tx>
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> 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