Skip to main content

KeyRow

Struct KeyRow 

Source
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: IndexPermutation

Index permutation this row was walked in.

§seg_starts: [usize; 4]

Start offset of each key slot (see the struct docs).

§commit_ts: CommitTs

Commit timestamp from the fixed key trailer.

Implementations§

Source§

impl<'k> KeyRow<'k>

Source

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.

Source

pub fn logical(&self) -> &[u8] ⓘ

Term bytes without the commit_ts trailer (the MVCC logical key).

Source

pub fn slot_bytes_at(&self, index: usize) -> &[u8] ⓘ

Raw bytes of the key slot at index in slot_order order.

Source

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.

Source

pub fn graph_segment(&self) -> &[u8] ⓘ

Raw bytes of the graph segment (empty = default graph).

Every permutation ends with the graph slot.

Source

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).

Trait Implementations§

Source§

impl<'k> Clone for KeyRow<'k>

Source§

fn clone(&self) -> KeyRow<'k>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'k> Debug for KeyRow<'k>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'k> Copy for KeyRow<'k>

Auto Trait Implementations§

§

impl<'k> Freeze for KeyRow<'k>

§

impl<'k> RefUnwindSafe for KeyRow<'k>

§

impl<'k> Send for KeyRow<'k>

§

impl<'k> Sync for KeyRow<'k>

§

impl<'k> Unpin for KeyRow<'k>

§

impl<'k> UnsafeUnpin for KeyRow<'k>

§

impl<'k> UnwindSafe for KeyRow<'k>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,