pub struct DbKey { /* private fields */ }Implementations§
Source§impl DbKey
impl DbKey
pub fn new<TKey>(prefix: &[u8], key: TKey) -> Self
pub fn new_with_bucket<TKey, TBucket>( prefix: &[u8], bucket: TBucket, key: TKey, ) -> Self
Sourcepub fn new_with_suffix<TKey, TSuffix>(
prefix: &[u8],
key: TKey,
suffix: TSuffix,
) -> Self
pub fn new_with_suffix<TKey, TSuffix>( prefix: &[u8], key: TKey, suffix: TSuffix, ) -> Self
Convenience constructor: [prefix || key || suffix]. The suffix bytes
sit after the logical key and are not counted toward prefix_len —
see DbKey::add_suffix for the rationale.
pub fn prefix_only(prefix: &[u8]) -> Self
Sourcepub fn add_bucket<TBucket>(&mut self, bucket: TBucket)
pub fn add_bucket<TBucket>(&mut self, bucket: TBucket)
add a bucket to the DBkey, this adds to the prefix length
pub fn add_key<TKey>(&mut self, key: TKey)
Sourcepub fn add_suffix<TSuffix>(&mut self, suffix: TSuffix)
pub fn add_suffix<TSuffix>(&mut self, suffix: TSuffix)
Append bytes after the logical key without changing prefix_len.
Unlike DbKey::add_bucket and DbKey::add_key — both of which sit
conceptually in front of the row key and therefore grow prefix_len —
a suffix is part of the row key itself (for example a version byte
appended to a versioned store’s keys). prefix_len must continue to
reflect only the store/bucket path so that iterator helpers that strip
the prefix see the correct boundary.
pub fn prefix_len(&self) -> usize
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DbKey
impl RefUnwindSafe for DbKey
impl Send for DbKey
impl Sync for DbKey
impl Unpin for DbKey
impl UnsafeUnpin for DbKey
impl UnwindSafe for DbKey
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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