pub struct EncodedIndexKey(/* private fields */);Expand description
The byte representation of a single field encoded under the
order-preserving format documented in docs/format.md.
Strongly-typed wrapper around Vec<u8> so the caller cannot
confuse an encoded key with a raw user value. The inner bytes
can be borrowed via as_bytes and consumed via into_bytes.
Implementations§
Source§impl EncodedIndexKey
impl EncodedIndexKey
Sourcepub fn into_bytes(self) -> Vec<u8> ⓘ
pub fn into_bytes(self) -> Vec<u8> ⓘ
Consume the wrapper and return the inner Vec<u8>.
Sourcepub fn from_bytes(bytes: Vec<u8>) -> Self
pub fn from_bytes(bytes: Vec<u8>) -> Self
Construct from raw bytes. Used by the maintenance path when
it composes an encoded user key with the trailing Id
suffix.
Trait Implementations§
Source§impl AsRef<[u8]> for EncodedIndexKey
impl AsRef<[u8]> for EncodedIndexKey
Source§impl Clone for EncodedIndexKey
impl Clone for EncodedIndexKey
Source§fn clone(&self) -> EncodedIndexKey
fn clone(&self) -> EncodedIndexKey
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for EncodedIndexKey
impl Debug for EncodedIndexKey
Source§impl From<EncodedIndexKey> for Vec<u8>
impl From<EncodedIndexKey> for Vec<u8>
Source§fn from(k: EncodedIndexKey) -> Self
fn from(k: EncodedIndexKey) -> Self
Converts to this type from the input type.
Source§impl Hash for EncodedIndexKey
impl Hash for EncodedIndexKey
Source§impl Ord for EncodedIndexKey
impl Ord for EncodedIndexKey
Source§fn cmp(&self, other: &EncodedIndexKey) -> Ordering
fn cmp(&self, other: &EncodedIndexKey) -> Ordering
1.21.0 (const: unstable) · 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 PartialEq for EncodedIndexKey
impl PartialEq for EncodedIndexKey
Source§fn eq(&self, other: &EncodedIndexKey) -> bool
fn eq(&self, other: &EncodedIndexKey) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for EncodedIndexKey
impl PartialOrd for EncodedIndexKey
impl Eq for EncodedIndexKey
impl StructuralPartialEq for EncodedIndexKey
Auto Trait Implementations§
impl Freeze for EncodedIndexKey
impl RefUnwindSafe for EncodedIndexKey
impl Send for EncodedIndexKey
impl Sync for EncodedIndexKey
impl Unpin for EncodedIndexKey
impl UnsafeUnpin for EncodedIndexKey
impl UnwindSafe for EncodedIndexKey
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