Struct TxRwImpl

Source
pub struct TxRwImpl<'tx> { /* private fields */ }
Expand description

Read/Write Transaction

Trait Implementations§

Source§

impl<'tx> Drop for TxRwImpl<'tx>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl<'tx: 'a, 'a> IntoIterator for &'a TxRwImpl<'tx>

Source§

type Item = (&'a [u8], BucketImpl<'tx, 'a>)

The type of the elements being iterated over.
Source§

type IntoIter = BucketIter<'tx, 'a>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl<'tx: 'a, 'a> IntoIterator for &'a mut TxRwImpl<'tx>

Source§

type Item = (&'a [u8], BucketRwImpl<'tx, 'a>)

The type of the elements being iterated over.
Source§

type IntoIter = BucketIterMut<'tx, 'a>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl<'tx> TxApi<'tx> for TxRwImpl<'tx>

Source§

fn id(&self) -> TxId

Returns the transaction id. Read more
Source§

fn size(&self) -> u64

Returns current database size in bytes as seen by this transaction. Read more
Source§

fn writable(&self) -> bool

Returns whether the transaction can perform write operations. Read more
Source§

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 stats(&self) -> Arc<TxStats>

Retrieves a copy of the current transaction statistics.
Source§

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
Source§

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,

👎Deprecated since 1.3.9: please use iter_* methods instead
Executes 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>

Returns page information for a given page number. Read more
Source§

fn iter_buckets<'a>(&'a self) -> BucketIter<'tx, 'a>

Source§

impl<'tx> TxRwApi<'tx> for TxRwImpl<'tx>

Source§

fn rollback(self) -> Result<()>

Closes the transaction and ignores all previous updates. Read more
Source§

fn commit(self) -> Result<()>

commit writes all changes to disk and updates the meta page. Returns an error if a disk write error occurs Read more
Source§

impl<'tx> TxRwRefApi<'tx> for TxRwImpl<'tx>

Source§

fn bucket_mut<'a, T: AsRef<[u8]>>( &'a mut self, name: T, ) -> Option<BucketRwImpl<'tx, 'a>>

Retrieves a mutable bucket by name. Read more
Source§

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>>

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>>

Creates a new bucket if it doesn’t already exist. Read more
Source§

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<()>

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)

OnCommit adds a handler function to be executed after the transaction successfully commits. Read more
Source§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<'tx, T> TxCheck<'tx> for T
where T: UnsealTx<'tx>,

Source§

fn check(&self) -> Vec<String>