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>
impl<'tx, 'p> BucketApi<'tx> for BucketRwImpl<'tx, 'p>
Source§fn cursor<'a>(&'a self) -> CursorImpl<'tx, 'a>
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>>
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]>
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
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<()>
fn for_each<F: FnMut(&'tx [u8], Option<&'tx [u8]>) -> Result<()>>( &self, f: F, ) -> Result<()>
👎Deprecated since 1.3.9: please use
iter_* methods insteadExecutes 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 moreSource§fn for_each_bucket<F: FnMut(&'tx [u8]) -> Result<()>>(&self, f: F) -> Result<()>
fn for_each_bucket<F: FnMut(&'tx [u8]) -> Result<()>>(&self, f: F) -> Result<()>
👎Deprecated since 1.3.9: please use
iter_* methods insteadExecutes a function for each bucket in a bucket.
Because this function uses a
crate::CursorApi, the iteration over keys is in lexicographical order. Read moreSource§fn stats(&self) -> BucketStats
fn stats(&self) -> BucketStats
Returns stats on a bucket. Read more
fn iter_entries<'a>(&'a self) -> EntryIter<'tx, 'a> ⓘ
fn iter_buckets<'a>(&'a self) -> BucketIter<'tx, 'a> ⓘ
Source§impl<'tx, 'p> BucketRwApi<'tx> for BucketRwImpl<'tx, 'p>
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>>
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>>
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>>
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>
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<()>
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<()>
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<()>
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<()>
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>
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)
fn set_fill_percent(&mut self, fill_percent: f64)
Set the fill percent of the bucket Read more
fn iter_mut_buckets<'a>(&'a mut self) -> BucketIterMut<'tx, 'a> ⓘ
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> 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