pub struct KeyEncoder;Expand description
KeyEncoder generates lexicographically ordered keys for table rows and indexes.
Layouts:
- Row key: 0x01 | table_id (u32 BE) | row_id (u64 BE)
- Index key: 0x02 | index_id (u32 BE) | encoded_value(s) | row_id (u64 BE)
- Sequence: 0x04 | table_id (u32 BE)
Implementations§
Source§impl KeyEncoder
impl KeyEncoder
Sourcepub fn index_key(
index_id: u32,
value: &SqlValue,
row_id: u64,
) -> Result<Vec<u8>>
pub fn index_key( index_id: u32, value: &SqlValue, row_id: u64, ) -> Result<Vec<u8>>
Index key (single value).
Sourcepub fn composite_index_key(
index_id: u32,
values: &[SqlValue],
row_id: u64,
) -> Result<Vec<u8>>
pub fn composite_index_key( index_id: u32, values: &[SqlValue], row_id: u64, ) -> Result<Vec<u8>>
Index key (composite).
Sourcepub fn index_value_prefix(index_id: u32, value: &SqlValue) -> Result<Vec<u8>>
pub fn index_value_prefix(index_id: u32, value: &SqlValue) -> Result<Vec<u8>>
Prefix for equality lookups on a specific value within an index.
Auto Trait Implementations§
impl Freeze for KeyEncoder
impl RefUnwindSafe for KeyEncoder
impl Send for KeyEncoder
impl Sync for KeyEncoder
impl Unpin for KeyEncoder
impl UnwindSafe for KeyEncoder
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more