pub struct KeyRow<'k> {
pub key: &'k [u8],
pub permutation: IndexPermutation,
pub seg_starts: [usize; 4],
pub commit_ts: CommitTs,
}Expand description
One raw versioned hexastore row handed to a scan’s emit callback.
key is slot_order(permutation) terms concatenated plus the 8-byte
descending commit_ts trailer; seg_starts[i] is the byte offset of key
slot i in IndexPermutation::slot_order order. On
IndexPermutation::Tsg (three slots) seg_starts[3] is the end of the
term prefix. Rows borrow the iterator’s buffer — copy out before the walk
advances.
Fields§
§key: &'k [u8]Full versioned key (term bytes ‖ descending commit_ts).
permutation: IndexPermutationIndex permutation this row was walked in.
seg_starts: [usize; 4]Start offset of each key slot (see the struct docs).
commit_ts: CommitTsCommit timestamp from the fixed key trailer.
Implementations§
Source§impl<'k> KeyRow<'k>
impl<'k> KeyRow<'k>
Sourcepub fn from_versioned_key(
key: &'k [u8],
permutation: IndexPermutation,
) -> Result<KeyRow<'k>, StorageError>
pub fn from_versioned_key( key: &'k [u8], permutation: IndexPermutation, ) -> Result<KeyRow<'k>, StorageError>
Walk a versioned key (slot terms ‖ descending commit_ts trailer)
and build the borrowing row view. A re-encoded row (no natural
trailer) appends any 8 bytes — the timestamp is only read by the
MVCC walk, never by wire emission.
Errors with StorageError::Corrupt on a short trailer, an unknown
type byte, or a term prefix that does not exactly cover the key.
Sourcepub fn logical(&self) -> &[u8] ⓘ
pub fn logical(&self) -> &[u8] ⓘ
Term bytes without the commit_ts trailer (the MVCC logical key).
Sourcepub fn slot_bytes_at(&self, index: usize) -> &[u8] ⓘ
pub fn slot_bytes_at(&self, index: usize) -> &[u8] ⓘ
Raw bytes of the key slot at index in slot_order order.
Sourcepub fn slot_bytes(&self, slot: QuadSlot) -> Option<&[u8]>
pub fn slot_bytes(&self, slot: QuadSlot) -> Option<&[u8]>
Raw bytes of a quad slot; None when the permutation omits it (the
Tsg predicate, implicit rdf:type). An empty slice is the default
graph’s zero-length encoding.
Sourcepub fn graph_segment(&self) -> &[u8] ⓘ
pub fn graph_segment(&self) -> &[u8] ⓘ
Raw bytes of the graph segment (empty = default graph).
Every permutation ends with the graph slot.
Sourcepub fn triple_prefix(&self) -> &[u8] ⓘ
pub fn triple_prefix(&self) -> &[u8] ⓘ
All slots before the graph (the S‖P‖O identity in key order).
Equal triples have equal prefixes: slot encodings are fixed-size per
type byte, so byte equality of the prefix is EncodedQuad::same_triple
without decoding. On Tsg the prefix is O‖S (the predicate is constant).