pub struct KeyRef<'a> { /* private fields */ }
Expand description
KeyRef can only contains a underlying u8 slice of Key
Implementations§
Source§impl<'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§
Source§impl<'a> From<KeyRef<'a>> for RawKeyPointer
impl<'a> From<KeyRef<'a>> for RawKeyPointer
Source§impl KeyExt for &KeyRef<'_>
impl KeyExt for &KeyRef<'_>
Source§fn as_key_ref(&self) -> KeyRef<'_>
fn as_key_ref(&self) -> KeyRef<'_>
Returns a KeyRef.
Source§fn parse_timestamp(&self) -> u64
fn parse_timestamp(&self) -> u64
Parses the timestamp from the key bytes. Read more
Source§fn same_key(&self, other: impl KeyExt) -> bool
fn same_key(&self, other: impl KeyExt) -> bool
Checks for key equality ignoring the version timestamp.
Source§fn 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 would be sorted higher than aa if we use bytes.compare
All keys should have timestamp.
Source§fn has_prefix(&self, prefix: impl KeyExt) -> bool
fn has_prefix(&self, prefix: impl KeyExt) -> bool
Returns whether the slice self begins with prefix.
Source§fn has_suffix(&self, suffix: impl KeyExt) -> bool
fn has_suffix(&self, suffix: impl KeyExt) -> bool
Returns whether the slice self ends with suffix.
Source§impl KeyExt for &mut KeyRef<'_>
impl KeyExt for &mut KeyRef<'_>
Source§fn as_key_ref(&self) -> KeyRef<'_>
fn as_key_ref(&self) -> KeyRef<'_>
Returns a KeyRef.
Source§fn parse_timestamp(&self) -> u64
fn parse_timestamp(&self) -> u64
Parses the timestamp from the key bytes. Read more
Source§fn same_key(&self, other: impl KeyExt) -> bool
fn same_key(&self, other: impl KeyExt) -> bool
Checks for key equality ignoring the version timestamp.
Source§fn 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 would be sorted higher than aa if we use bytes.compare
All keys should have timestamp.
Source§fn has_prefix(&self, prefix: impl KeyExt) -> bool
fn has_prefix(&self, prefix: impl KeyExt) -> bool
Returns whether the slice self begins with prefix.
Source§fn has_suffix(&self, suffix: impl KeyExt) -> bool
fn has_suffix(&self, suffix: impl KeyExt) -> bool
Returns whether the slice self ends with suffix.
Source§impl KeyExt for KeyRef<'_>
impl KeyExt for KeyRef<'_>
Source§fn as_key_ref(&self) -> KeyRef<'_>
fn as_key_ref(&self) -> KeyRef<'_>
Returns a KeyRef.
Source§fn parse_timestamp(&self) -> u64
fn parse_timestamp(&self) -> u64
Parses the timestamp from the key bytes. Read more
Source§fn same_key(&self, other: impl KeyExt) -> bool
fn same_key(&self, other: impl KeyExt) -> bool
Checks for key equality ignoring the version timestamp.
Source§fn 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 would be sorted higher than aa if we use bytes.compare
All keys should have timestamp.
Source§fn has_prefix(&self, prefix: impl KeyExt) -> bool
fn has_prefix(&self, prefix: impl KeyExt) -> bool
Returns whether the slice self begins with prefix.
Source§fn has_suffix(&self, suffix: impl KeyExt) -> bool
fn has_suffix(&self, suffix: impl KeyExt) -> bool
Returns whether the slice self ends with suffix.
Source§impl<'a> Ord for KeyRef<'a>
impl<'a> Ord for KeyRef<'a>
Source§fn 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 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<'a, K: KeyExt> PartialOrd<K> for KeyRef<'a>
impl<'a, K: KeyExt> PartialOrd<K> for KeyRef<'a>
Source§impl<'a> PartialOrd<KeyRef<'a>> for [u8]
impl<'a> PartialOrd<KeyRef<'a>> for [u8]
Source§impl<'a> PartialOrd<KeyRef<'a>> for Box<[u8]>
impl<'a> PartialOrd<KeyRef<'a>> for Box<[u8]>
Source§impl<'a> PartialOrd<KeyRef<'a>> for Bytes
impl<'a> PartialOrd<KeyRef<'a>> for Bytes
Source§impl<'a> PartialOrd<KeyRef<'a>> for BytesMut
impl<'a> PartialOrd<KeyRef<'a>> for BytesMut
Source§impl<'a> PartialOrd<KeyRef<'a>> for KeyMut
impl<'a> PartialOrd<KeyRef<'a>> for KeyMut
Source§impl<'a> PartialOrd<KeyRef<'a>> for String
impl<'a> PartialOrd<KeyRef<'a>> for String
Source§impl<'a> PartialOrd<KeyRef<'a>> for Vec<u8>
impl<'a> PartialOrd<KeyRef<'a>> for Vec<u8>
Source§impl<'a> PartialOrd<KeyRef<'a>> for str
impl<'a> PartialOrd<KeyRef<'a>> for str
impl<'a> Copy for KeyRef<'a>
impl<'a> Eq for KeyRef<'a>
Auto Trait Implementations§
impl<'a> Freeze for KeyRef<'a>
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§
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