pub struct Q42Volume { /* private fields */ }Expand description
Memory-mapped unified v2 volume reader.
Implementations§
Source§impl Q42Volume
impl Q42Volume
Sourcepub fn block_cursor(&self) -> Q42BlockCursor<'_>
pub fn block_cursor(&self) -> Q42BlockCursor<'_>
Return a sequential cursor which decodes into a caller-owned buffer.
Source§impl Q42Volume
impl Q42Volume
pub fn open(path: &Path) -> Result<Self>
pub fn header(&self) -> &Q42VolumeHeader
pub fn as_bytes(&self) -> &[u8] ⓘ
pub fn lex_bytes(&self) -> &[u8] ⓘ
pub fn lex_view(&self) -> Result<Q42LexMmap<'_>, LexError>
pub fn bidx_bytes(&self) -> &[u8] ⓘ
Sourcepub fn volume_manifest_bytes(&self) -> Result<Option<&[u8]>>
pub fn volume_manifest_bytes(&self) -> Result<Option<&[u8]>>
Return the root descriptor bytes embedded between the lexicon and BIDX.
Sourcepub fn volume_manifest(&self) -> Result<Option<Q42VolumeManifest>>
pub fn volume_manifest(&self) -> Result<Option<Q42VolumeManifest>>
Decode the front-embedded descriptor for a logical multi-segment Q42
snapshot. A regular v3 Q42 returns Ok(None).
pub fn block_count(&self) -> u64
Sourcepub fn verify_all_blocks(&self) -> Result<Q42VerificationReceipt>
pub fn verify_all_blocks(&self) -> Result<Q42VerificationReceipt>
Decode and verify every block without materialising the graph. This checks SuperBlock counts, parity, per-block/global object ordering, and the BIDX range advertised for each block. Logical roots have no local records and must be verified through their manifest children.
Sourcepub fn bidx_blocks_for_hash(&self, object_hash: u64) -> Vec<usize>
pub fn bidx_blocks_for_hash(&self, object_hash: u64) -> Vec<usize>
Binary-search BIDX for object_hash; returns block indices that may contain it.
This allocating compatibility helper now returns the complete matching
interval. New query paths should use Self::bidx_blocks_for_hash_into
to enumerate a high-frequency object through a caller buffer.
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 full contiguous BIDX interval that may contain object_hash.
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 out with one page of matching BIDX block indices.
cursor is an offset relative to the returned interval’s start. Resume
with next_cursor until it is None; an empty output buffer never
causes a silent partial success.
Sourcepub fn object_hash_bounds(&self) -> Option<(u64, u64)>
pub fn object_hash_bounds(&self) -> Option<(u64, u64)>
Minimum and maximum object hash advertised by this segment’s validated
BIDX. Empty root/catalog segments return None.
pub fn block_directory_entry(&self, index: usize) -> Result<BlockDirectoryEntry>
Sourcepub fn read_superblock_into(
&self,
index: usize,
out: &mut [u8],
) -> Result<usize>
pub fn read_superblock_into( &self, index: usize, out: &mut [u8], ) -> Result<usize>
Decompress SuperBlock index into out (must be >= 40960 bytes).
Sourcepub fn read_all_quins(&self) -> Result<Vec<NQuin>>
pub fn read_all_quins(&self) -> Result<Vec<NQuin>>
Read every live Quin from this volume’s SuperBlocks into a heap Vec.
Cold path (CLI / daemon vault load). A .q42 is not a flat array of
48-byte records — each SuperBlock is LZ4-compressed and carries a 160-byte
header whose bytes [16..24] hold the block’s live quin count. Callers that
bytemuck::cast_slice the raw file will panic (OutputSliceWouldHaveSlop)
because the file length is not a multiple of QUIN_SIZE. Use this instead.
Auto Trait Implementations§
impl Freeze for Q42Volume
impl RefUnwindSafe for Q42Volume
impl Send for Q42Volume
impl Sync for Q42Volume
impl Unpin for Q42Volume
impl UnsafeUnpin for Q42Volume
impl UnwindSafe for Q42Volume
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