#[repr(transparent)]pub struct KeyRef<'a> { /* private fields */ }Expand description
KeyRef can only contains a underlying u8 slice of Key
Implementations
sourceimpl<'a> KeyRef<'a>
impl<'a> KeyRef<'a>
sourcepub unsafe fn from_raw_key_pointer(rp: RawKeyPointer) -> Self
pub unsafe fn from_raw_key_pointer(rp: RawKeyPointer) -> Self
sourcepub unsafe fn from_raw_pointer(ptr: *const u8, len: usize) -> Self
pub unsafe fn from_raw_pointer(ptr: *const u8, len: usize) -> Self
Trait Implementations
sourceimpl<'a> From<KeyRef<'a>> for RawKeyPointer
impl<'a> From<KeyRef<'a>> for RawKeyPointer
sourceimpl KeyExt for &KeyRef<'_>
impl KeyExt for &KeyRef<'_>
sourcefn as_bytes(&self) -> &[u8]ⓘNotable traits for &[u8]impl<'_> Read for &[u8]impl<'_> Write for &mut [u8]
fn as_bytes(&self) -> &[u8]ⓘNotable traits for &[u8]impl<'_> Read for &[u8]impl<'_> Write for &mut [u8]
Returns the underlying slice of key (with timestamp data).
sourcefn as_key_ref(&self) -> KeyRef<'_>
fn as_key_ref(&self) -> KeyRef<'_>
Returns a KeyRef.
sourcefn parse_key(&self) -> &[u8]ⓘNotable traits for &[u8]impl<'_> Read for &[u8]impl<'_> Write for &mut [u8]
fn parse_key(&self) -> &[u8]ⓘNotable traits for &[u8]impl<'_> Read for &[u8]impl<'_> Write for &mut [u8]
Parses the actual key from the key bytes.
sourcefn parse_timestamp(&self) -> u64
fn parse_timestamp(&self) -> u64
Parses the timestamp from the key bytes. Read more
sourcefn same_key(&self, other: impl KeyExt) -> bool
fn same_key(&self, other: impl KeyExt) -> bool
Checks for key equality ignoring the version timestamp.
sourcefn compare_key(&self, other: impl KeyExt) -> Ordering
fn compare_key(&self, other: impl KeyExt) -> Ordering
Checks the key without timestamp and checks the timestamp if keyNoTs
is same.
a
sourcefn has_prefix(&self, prefix: impl KeyExt) -> bool
fn has_prefix(&self, prefix: impl KeyExt) -> bool
Returns whether the slice self begins with prefix.
sourcefn has_suffix(&self, suffix: impl KeyExt) -> bool
fn has_suffix(&self, suffix: impl KeyExt) -> bool
Returns whether the slice self ends with suffix.
sourcefn longest_prefix(&self, other: impl KeyExt) -> &[u8]ⓘNotable traits for &[u8]impl<'_> Read for &[u8]impl<'_> Write for &mut [u8]
fn longest_prefix(&self, other: impl KeyExt) -> &[u8]ⓘNotable traits for &[u8]impl<'_> Read for &[u8]impl<'_> Write for &mut [u8]
Finds the longest shared prefix
sourcefn longest_suffix(&self, other: impl KeyExt) -> &[u8]ⓘNotable traits for &[u8]impl<'_> Read for &[u8]impl<'_> Write for &mut [u8]
fn longest_suffix(&self, other: impl KeyExt) -> &[u8]ⓘNotable traits for &[u8]impl<'_> Read for &[u8]impl<'_> Write for &mut [u8]
Finds the longest shared suffix
sourceimpl KeyExt for &mut KeyRef<'_>
impl KeyExt for &mut KeyRef<'_>
sourcefn as_bytes(&self) -> &[u8]ⓘNotable traits for &[u8]impl<'_> Read for &[u8]impl<'_> Write for &mut [u8]
fn as_bytes(&self) -> &[u8]ⓘNotable traits for &[u8]impl<'_> Read for &[u8]impl<'_> Write for &mut [u8]
Returns the underlying slice of key (with timestamp data).
sourcefn as_key_ref(&self) -> KeyRef<'_>
fn as_key_ref(&self) -> KeyRef<'_>
Returns a KeyRef.
sourcefn parse_key(&self) -> &[u8]ⓘNotable traits for &[u8]impl<'_> Read for &[u8]impl<'_> Write for &mut [u8]
fn parse_key(&self) -> &[u8]ⓘNotable traits for &[u8]impl<'_> Read for &[u8]impl<'_> Write for &mut [u8]
Parses the actual key from the key bytes.
sourcefn parse_timestamp(&self) -> u64
fn parse_timestamp(&self) -> u64
Parses the timestamp from the key bytes. Read more
sourcefn same_key(&self, other: impl KeyExt) -> bool
fn same_key(&self, other: impl KeyExt) -> bool
Checks for key equality ignoring the version timestamp.
sourcefn compare_key(&self, other: impl KeyExt) -> Ordering
fn compare_key(&self, other: impl KeyExt) -> Ordering
Checks the key without timestamp and checks the timestamp if keyNoTs
is same.
a
sourcefn has_prefix(&self, prefix: impl KeyExt) -> bool
fn has_prefix(&self, prefix: impl KeyExt) -> bool
Returns whether the slice self begins with prefix.
sourcefn has_suffix(&self, suffix: impl KeyExt) -> bool
fn has_suffix(&self, suffix: impl KeyExt) -> bool
Returns whether the slice self ends with suffix.
sourcefn longest_prefix(&self, other: impl KeyExt) -> &[u8]ⓘNotable traits for &[u8]impl<'_> Read for &[u8]impl<'_> Write for &mut [u8]
fn longest_prefix(&self, other: impl KeyExt) -> &[u8]ⓘNotable traits for &[u8]impl<'_> Read for &[u8]impl<'_> Write for &mut [u8]
Finds the longest shared prefix
sourcefn longest_suffix(&self, other: impl KeyExt) -> &[u8]ⓘNotable traits for &[u8]impl<'_> Read for &[u8]impl<'_> Write for &mut [u8]
fn longest_suffix(&self, other: impl KeyExt) -> &[u8]ⓘNotable traits for &[u8]impl<'_> Read for &[u8]impl<'_> Write for &mut [u8]
Finds the longest shared suffix
sourceimpl KeyExt for KeyRef<'_>
impl KeyExt for KeyRef<'_>
sourcefn as_bytes(&self) -> &[u8]ⓘNotable traits for &[u8]impl<'_> Read for &[u8]impl<'_> Write for &mut [u8]
fn as_bytes(&self) -> &[u8]ⓘNotable traits for &[u8]impl<'_> Read for &[u8]impl<'_> Write for &mut [u8]
Returns the underlying slice of key (with timestamp data).
sourcefn as_key_ref(&self) -> KeyRef<'_>
fn as_key_ref(&self) -> KeyRef<'_>
Returns a KeyRef.
sourcefn parse_key(&self) -> &[u8]ⓘNotable traits for &[u8]impl<'_> Read for &[u8]impl<'_> Write for &mut [u8]
fn parse_key(&self) -> &[u8]ⓘNotable traits for &[u8]impl<'_> Read for &[u8]impl<'_> Write for &mut [u8]
Parses the actual key from the key bytes.
sourcefn parse_timestamp(&self) -> u64
fn parse_timestamp(&self) -> u64
Parses the timestamp from the key bytes. Read more
sourcefn same_key(&self, other: impl KeyExt) -> bool
fn same_key(&self, other: impl KeyExt) -> bool
Checks for key equality ignoring the version timestamp.
sourcefn compare_key(&self, other: impl KeyExt) -> Ordering
fn compare_key(&self, other: impl KeyExt) -> Ordering
Checks the key without timestamp and checks the timestamp if keyNoTs
is same.
a
sourcefn has_prefix(&self, prefix: impl KeyExt) -> bool
fn has_prefix(&self, prefix: impl KeyExt) -> bool
Returns whether the slice self begins with prefix.
sourcefn has_suffix(&self, suffix: impl KeyExt) -> bool
fn has_suffix(&self, suffix: impl KeyExt) -> bool
Returns whether the slice self ends with suffix.
sourcefn longest_prefix(&self, other: impl KeyExt) -> &[u8]ⓘNotable traits for &[u8]impl<'_> Read for &[u8]impl<'_> Write for &mut [u8]
fn longest_prefix(&self, other: impl KeyExt) -> &[u8]ⓘNotable traits for &[u8]impl<'_> Read for &[u8]impl<'_> Write for &mut [u8]
Finds the longest shared prefix
sourcefn longest_suffix(&self, other: impl KeyExt) -> &[u8]ⓘNotable traits for &[u8]impl<'_> Read for &[u8]impl<'_> Write for &mut [u8]
fn longest_suffix(&self, other: impl KeyExt) -> &[u8]ⓘNotable traits for &[u8]impl<'_> Read for &[u8]impl<'_> Write for &mut [u8]
Finds the longest shared suffix
sourceimpl<'a> Ord for KeyRef<'a>
impl<'a> Ord for KeyRef<'a>
sourcefn cmp(&self, other: &Self) -> Ordering
fn cmp(&self, other: &Self) -> Ordering
Checks the key without timestamp and checks the timestamp if keyNoTs
is same.
a
1.21.0 · sourcefn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
sourceimpl<'a, K: KeyExt> PartialOrd<K> for KeyRef<'a>
impl<'a, K: KeyExt> PartialOrd<K> for KeyRef<'a>
sourcefn partial_cmp(&self, other: &K) -> Option<Ordering>
fn partial_cmp(&self, other: &K) -> Option<Ordering>
This method returns an ordering between self and other values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
sourceimpl<'a> PartialOrd<KeyRef<'a>> for Bytes
impl<'a> PartialOrd<KeyRef<'a>> for Bytes
sourcefn partial_cmp(&self, other: &KeyRef<'a>) -> Option<Ordering>
fn partial_cmp(&self, other: &KeyRef<'a>) -> Option<Ordering>
This method returns an ordering between self and other values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
sourceimpl<'a> PartialOrd<KeyRef<'a>> for BytesMut
impl<'a> PartialOrd<KeyRef<'a>> for BytesMut
sourcefn partial_cmp(&self, other: &KeyRef<'a>) -> Option<Ordering>
fn partial_cmp(&self, other: &KeyRef<'a>) -> Option<Ordering>
This method returns an ordering between self and other values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
sourceimpl<'a> PartialOrd<KeyRef<'a>> for Box<[u8]>
impl<'a> PartialOrd<KeyRef<'a>> for Box<[u8]>
sourcefn partial_cmp(&self, other: &KeyRef<'a>) -> Option<Ordering>
fn partial_cmp(&self, other: &KeyRef<'a>) -> Option<Ordering>
This method returns an ordering between self and other values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
sourceimpl<'a> PartialOrd<KeyRef<'a>> for KeyMut
impl<'a> PartialOrd<KeyRef<'a>> for KeyMut
sourcefn partial_cmp(&self, other: &KeyRef<'a>) -> Option<Ordering>
fn partial_cmp(&self, other: &KeyRef<'a>) -> Option<Ordering>
This method returns an ordering between self and other values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
sourceimpl<'a> PartialOrd<KeyRef<'a>> for [u8]
impl<'a> PartialOrd<KeyRef<'a>> for [u8]
sourcefn partial_cmp(&self, other: &KeyRef<'a>) -> Option<Ordering>
fn partial_cmp(&self, other: &KeyRef<'a>) -> Option<Ordering>
This method returns an ordering between self and other values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
sourceimpl<'a> PartialOrd<KeyRef<'a>> for Vec<u8>
impl<'a> PartialOrd<KeyRef<'a>> for Vec<u8>
sourcefn partial_cmp(&self, other: &KeyRef<'a>) -> Option<Ordering>
fn partial_cmp(&self, other: &KeyRef<'a>) -> Option<Ordering>
This method returns an ordering between self and other values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
sourceimpl<'a> PartialOrd<KeyRef<'a>> for str
impl<'a> PartialOrd<KeyRef<'a>> for str
sourcefn partial_cmp(&self, other: &KeyRef<'a>) -> Option<Ordering>
fn partial_cmp(&self, other: &KeyRef<'a>) -> Option<Ordering>
This method returns an ordering between self and other values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
sourceimpl<'a> PartialOrd<KeyRef<'a>> for String
impl<'a> PartialOrd<KeyRef<'a>> for String
sourcefn partial_cmp(&self, other: &KeyRef<'a>) -> Option<Ordering>
fn partial_cmp(&self, other: &KeyRef<'a>) -> Option<Ordering>
This method returns an ordering between self and other values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
impl<'a> Copy for KeyRef<'a>
impl<'a> Eq for KeyRef<'a>
Auto Trait Implementations
impl<'a> RefUnwindSafe for KeyRef<'a>
impl<'a> Send for KeyRef<'a>
impl<'a> Sync for KeyRef<'a>
impl<'a> Unpin for KeyRef<'a>
impl<'a> UnwindSafe for KeyRef<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more