pub trait KeyExt {
Show 13 methods
// Required method
fn as_bytes(&self) -> &[u8] ⓘ;
// Provided methods
fn as_ptr(&self) -> *const u8 { ... }
fn as_key_ref(&self) -> KeyRef<'_> { ... }
fn parse_key(&self) -> &[u8] ⓘ { ... }
fn parse_timestamp(&self) -> u64 { ... }
fn same_key(&self, other: impl KeyExt) -> bool { ... }
fn compare_key(&self, other: impl KeyExt) -> Ordering { ... }
fn has_prefix(&self, prefix: impl KeyExt) -> bool { ... }
fn has_suffix(&self, suffix: impl KeyExt) -> bool { ... }
fn longest_prefix(&self, other: impl KeyExt) -> &[u8] ⓘ { ... }
fn longest_suffix(&self, other: impl KeyExt) -> &[u8] ⓘ { ... }
fn longest_prefix_lossy(&self, other: impl KeyExt) -> Cow<'_, [u8]> { ... }
fn longest_suffix_lossy(&self, other: impl KeyExt) -> Cow<'_, [u8]> { ... }
}Expand description
Extensions for Key
Required Methods§
Provided Methods§
Sourcefn as_key_ref(&self) -> KeyRef<'_>
fn as_key_ref(&self) -> KeyRef<'_>
Returns a KeyRef.
Sourcefn parse_timestamp(&self) -> u64
fn parse_timestamp(&self) -> u64
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] ⓘ
fn longest_prefix(&self, other: impl KeyExt) -> &[u8] ⓘ
Finds the longest shared prefix
Sourcefn longest_suffix(&self, other: impl KeyExt) -> &[u8] ⓘ
fn longest_suffix(&self, other: impl KeyExt) -> &[u8] ⓘ
Finds the longest shared suffix
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.