pub struct Q42RangeVolume<S: Q42RangeSource> { /* private fields */ }Expand description
A Q42 reader that fetches exactly the bytes needed from a random-access source. All variable-size buffers remain caller-owned.
Implementations§
Source§impl<S: Q42RangeSource> Q42RangeVolume<S>
impl<S: Q42RangeSource> Q42RangeVolume<S>
pub fn open(source: S) -> Result<Self>
pub fn header(&self) -> &Q42VolumeHeader
pub fn source_length(&self) -> u64
pub fn block_count(&self) -> u64
Sourcepub fn execute_query_page_into(
&self,
plan: Q42RangeQueryPlan,
cursor: Q42RangeQueryCursor,
compressed: &mut [u8],
decoded: &mut [u8],
out: &mut [NQuin],
) -> Result<Q42RangeQueryPage>
pub fn execute_query_page_into( &self, plan: Q42RangeQueryPlan, cursor: Q42RangeQueryCursor, compressed: &mut [u8], decoded: &mut [u8], out: &mut [NQuin], ) -> Result<Q42RangeQueryPage>
Execute one caller-buffered page of a physical Q42 scan. A bound object uses BIDX to avoid unrelated SuperBlocks; all other patterns stream one block at a time. This is the reusable low-level path that a SPARQL planner can drive without materialising a graph snapshot.
pub fn source(&self) -> &S
pub fn read_lexicon_into(&self, out: &mut [u8]) -> Result<()>
Sourcepub fn read_lexicon_prefix_into(&self, out: &mut [u8; 32]) -> Result<()>
pub fn read_lexicon_prefix_into(&self, out: &mut [u8; 32]) -> Result<()>
Read the fixed Q42LEX header only. This is used to validate a routed lexicon shard without transferring its dictionary pages.
Sourcepub fn lookup_lexicon_hash_into(
&self,
hash: u64,
page_scratch: &mut [u8],
out: &mut [u8],
) -> Result<Option<usize>>
pub fn lookup_lexicon_hash_into( &self, hash: u64, page_scratch: &mut [u8], out: &mut [u8], ) -> Result<Option<usize>>
Resolve a string from a paged Q42LEX dictionary using exact range reads.
page_scratch and out are caller-owned; neither a full lexicon nor a
decoded page is retained by the reader. Returns the UTF-8 byte length
written into out, or None when the hash is absent.
pub fn read_bidx_into(&self, out: &mut [u8]) -> Result<()>
Sourcepub fn volume_manifest_length(&self) -> Result<Option<usize>>
pub fn volume_manifest_length(&self) -> Result<Option<usize>>
Return the size of the front-embedded logical-volume manifest, if this
segment is a root. The caller can use Self::read_volume_manifest_into
to retrieve exactly those bytes.
pub fn read_volume_manifest_into(&self, out: &mut [u8]) -> Result<bool>
pub fn block_directory_entry(&self, index: usize) -> Result<BlockDirectoryEntry>
Sourcepub fn object_hash_bounds(&self) -> Result<Option<(u64, u64)>>
pub fn object_hash_bounds(&self) -> Result<Option<(u64, u64)>>
Object-hash bounds read from the first and last BIDX entry. This avoids materialising the index merely to validate a manifest segment.
Sourcepub fn bidx_block_range_for_hash(
&self,
object_hash: u64,
) -> Result<Option<BidxBlockRange>>
pub fn bidx_block_range_for_hash( &self, object_hash: u64, ) -> Result<Option<BidxBlockRange>>
Return the complete BIDX interval which can contain an object hash. Each comparison fetches one fixed 16-byte BIDX entry; there is no index allocation or whole-index transfer.
Sourcepub fn bidx_blocks_for_hash_into(
&self,
object_hash: u64,
cursor: usize,
out: &mut [usize],
) -> Result<Option<BidxMatchPage>>
pub fn bidx_blocks_for_hash_into( &self, object_hash: u64, cursor: usize, out: &mut [usize], ) -> Result<Option<BidxMatchPage>>
Fill one bounded page of BIDX block indices. This retains complete heavy-hitter semantics while forcing callers to provide the cap.
Sourcepub fn find_object_into(
&self,
object_hash: u64,
cursor: Q42ObjectSearchCursor,
compressed: &mut [u8],
decoded: &mut [u8],
out: &mut [NQuin],
) -> Result<Option<Q42ObjectMatchPage>>
pub fn find_object_into( &self, object_hash: u64, cursor: Q42ObjectSearchCursor, compressed: &mut [u8], decoded: &mut [u8], out: &mut [NQuin], ) -> Result<Option<Q42ObjectMatchPage>>
Find Quins whose object equals object_hash, using the BIDX to fetch
only candidate SuperBlocks. compressed, decoded, and out are all
caller-owned. Reuse cursor from the returned page until it is None.
Sourcepub fn read_superblock_into(
&self,
index: usize,
compressed: &mut [u8],
out: &mut [u8],
) -> Result<usize>
pub fn read_superblock_into( &self, index: usize, compressed: &mut [u8], out: &mut [u8], ) -> Result<usize>
Fetch and decode one block. compressed must fit the directory entry;
out must be at least one full decoded SuperBlock.
pub fn into_source(self) -> S
Auto Trait Implementations§
impl<S> Freeze for Q42RangeVolume<S>where
S: Freeze,
impl<S> RefUnwindSafe for Q42RangeVolume<S>where
S: RefUnwindSafe,
impl<S> Send for Q42RangeVolume<S>where
S: Send,
impl<S> Sync for Q42RangeVolume<S>where
S: Sync,
impl<S> Unpin for Q42RangeVolume<S>where
S: Unpin,
impl<S> UnsafeUnpin for Q42RangeVolume<S>where
S: UnsafeUnpin,
impl<S> UnwindSafe for Q42RangeVolume<S>where
S: UnwindSafe,
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more