Struct BucketRwImpl

Source
pub struct BucketRwImpl<'tx: 'p, 'p> { /* private fields */ }
Expand description

Read/Write Bucket

Trait Implementations§

Source§

impl<'tx, 'p> BucketApi<'tx> for BucketRwImpl<'tx, 'p>

Source§

fn root(&self) -> PgId

Returns the bucket’s root page id. Read more
Source§

fn writable(&self) -> bool

Returns whether the bucket is writable. Read more
Source§

fn cursor<'a>(&'a self) -> CursorImpl<'tx, 'a>

Creates a cursor associated with the bucket. Read more
Source§

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

Retrieves a nested bucket by name. Read more
Source§

fn get<T: AsRef<[u8]>>(&self, key: T) -> Option<&[u8]>

Retrieves the value for a key in the bucket. Read more
Source§

fn sequence(&self) -> u64

Returns the current integer for the bucket without incrementing it. Read more
Source§

fn for_each<F: FnMut(&'tx [u8], Option<&'tx [u8]>) -> Result<()>>( &self, f: F, ) -> Result<()>

👎Deprecated since 1.3.9: please use iter_* methods instead
Executes a function for each key/value pair in a bucket. Because this uses a crate::CursorApi, the iteration over keys is in lexicographical order. Read more
Source§

fn for_each_bucket<F: FnMut(&'tx [u8]) -> Result<()>>(&self, f: F) -> Result<()>

👎Deprecated since 1.3.9: please use iter_* methods instead
Executes a function for each bucket in a bucket. Because this function uses a crate::CursorApi, the iteration over keys is in lexicographical order. Read more
Source§

fn stats(&self) -> BucketStats

Returns stats on a bucket. Read more
Source§

fn iter_entries<'a>(&'a self) -> EntryIter<'tx, 'a>

Source§

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

Source§

impl<'tx, 'p> BucketRwApi<'tx> for BucketRwImpl<'tx, 'p>

Source§

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

Retrieves a nested mutable bucket by name. Read more
Source§

fn create_bucket<'a, T: AsRef<[u8]>>( &'a mut self, key: T, ) -> Result<BucketRwImpl<'tx, 'a>>

Creates a new bucket at the given key and returns the new bucket. Read more
Source§

fn create_bucket_if_not_exists<'a, T: AsRef<[u8]>>( &'a mut self, key: T, ) -> Result<BucketRwImpl<'tx, 'a>>

CreateBucketIfNotExists creates a new bucket if it doesn’t already exist and returns a reference to it. Read more
Source§

fn cursor_mut<'a>(&'a self) -> CursorRwImpl<'tx, 'a>

Cursor creates a cursor associated with the bucket. Read more
Source§

fn delete_bucket<T: AsRef<[u8]>>(&mut self, key: T) -> Result<()>

Deletes a bucket at the given key. Read more
Source§

fn put<T: AsRef<[u8]>, U: AsRef<[u8]>>(&mut self, key: T, data: U) -> Result<()>

Sets the value for a key in the bucket. Read more
Source§

fn delete<T: AsRef<[u8]>>(&mut self, key: T) -> Result<()>

Removes a key from the bucket. Read more
Source§

fn set_sequence(&mut self, v: u64) -> Result<()>

Updates the sequence number for the bucket. Read more
Source§

fn next_sequence(&mut self) -> Result<u64>

Returns the auto-incremented integer for the bucket. Read more
Source§

fn set_fill_percent(&mut self, fill_percent: f64)

Set the fill percent of the bucket Read more
Source§

fn iter_mut_buckets<'a>(&'a mut self) -> BucketIterMut<'tx, 'a>

Source§

fn rev_iter_mut_buckets<'a>(&'a mut self) -> BucketIterMut<'tx, 'a>

Auto Trait Implementations§

§

impl<'tx, 'p> Freeze for BucketRwImpl<'tx, 'p>

§

impl<'tx, 'p> !RefUnwindSafe for BucketRwImpl<'tx, 'p>

§

impl<'tx, 'p> !Send for BucketRwImpl<'tx, 'p>

§

impl<'tx, 'p> !Sync for BucketRwImpl<'tx, 'p>

§

impl<'tx, 'p> Unpin for BucketRwImpl<'tx, 'p>

§

impl<'tx, 'p> !UnwindSafe for BucketRwImpl<'tx, 'p>

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.