pub struct BucketedKey<K: Key> {
pub base_key: K,
pub bucket: u64,
}Expand description
A bucketed key that implements redb::Key for storage.
BucketedKey stores a base key along with its computed bucket. The bucket serves as the primary sort key (prefix) while the base key provides secondary sorting within each bucket.
Fields§
§base_key: K§bucket: u64Implementations§
Trait Implementations§
Source§impl<K: Clone + Key> Clone for BucketedKey<K>
impl<K: Clone + Key> Clone for BucketedKey<K>
Source§fn clone(&self) -> BucketedKey<K>
fn clone(&self) -> BucketedKey<K>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Key for BucketedKey<u64>
impl Key for BucketedKey<u64>
Source§impl Value for BucketedKey<u64>
impl Value for BucketedKey<u64>
Source§type SelfType<'a> = BucketedKey<u64>
where
Self: 'a
type SelfType<'a> = BucketedKey<u64> where Self: 'a
SelfType<'a> must be the same type as Self with all lifetimes replaced with ’atype AsBytes<'a> = Vec<u8> where Self: 'a
Source§fn fixed_width() -> Option<usize>
fn fixed_width() -> Option<usize>
Width of a fixed type, or None for variable width
Source§fn from_bytes<'a>(data: &'a [u8]) -> Self::SelfType<'a>where
Self: 'a,
fn from_bytes<'a>(data: &'a [u8]) -> Self::SelfType<'a>where
Self: 'a,
Deserializes data
Implementations may return a view over data, or an owned type
Auto Trait Implementations§
impl<K> Freeze for BucketedKey<K>where
K: Freeze,
impl<K> RefUnwindSafe for BucketedKey<K>where
K: RefUnwindSafe,
impl<K> Send for BucketedKey<K>where
K: Send,
impl<K> Sync for BucketedKey<K>where
K: Sync,
impl<K> Unpin for BucketedKey<K>where
K: Unpin,
impl<K> UnwindSafe for BucketedKey<K>where
K: UnwindSafe,
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