pub struct BlockPostingList { /* private fields */ }Implementations§
Source§impl BlockPostingList
impl BlockPostingList
Sourcepub fn from_posting_list(list: &PostingList) -> Result<Self>
pub fn from_posting_list(list: &PostingList) -> Result<Self>
Build from a posting list
Sourcepub fn serialize<W: Write>(&self, writer: &mut W) -> Result<()>
pub fn serialize<W: Write>(&self, writer: &mut W) -> Result<()>
Serialize the block posting list (footer-based: data first).
Format:
[block data: data_len bytes]
[skip entries: N × 16 bytes (base_doc, last_doc, offset, block_max_tf)]
[footer: data_len(4) + skip_count(4) + doc_count(4) + max_tf(4) = 16 bytes]Sourcepub fn deserialize(raw: &[u8]) -> Result<Self>
pub fn deserialize(raw: &[u8]) -> Result<Self>
Deserialize from a byte slice (footer-based format).
pub fn doc_count(&self) -> u32
Sourcepub fn num_blocks(&self) -> usize
pub fn num_blocks(&self) -> usize
Get number of blocks
Sourcepub fn block_info(
&self,
block_idx: usize,
) -> Option<(DocId, DocId, usize, usize, u32)>
pub fn block_info( &self, block_idx: usize, ) -> Option<(DocId, DocId, usize, usize, u32)>
Get block metadata: (base_doc_id, last_doc_id, data_offset, data_len, block_max_tf)
Sourcepub fn block_max_tf(&self, block_idx: usize) -> Option<u32>
pub fn block_max_tf(&self, block_idx: usize) -> Option<u32>
Get block’s max term frequency for Block-Max WAND
Sourcepub fn block_data(&self, block_idx: usize) -> Option<&[u8]>
pub fn block_data(&self, block_idx: usize) -> Option<&[u8]>
Get raw block data for direct copying during merge
Sourcepub fn concatenate_blocks(sources: &[(BlockPostingList, u32)]) -> Result<Self>
pub fn concatenate_blocks(sources: &[(BlockPostingList, u32)]) -> Result<Self>
Concatenate blocks from multiple posting lists with doc_id remapping This is O(num_blocks) instead of O(num_postings)
Sourcepub fn concatenate_streaming<W: Write>(
sources: &[(&[u8], u32)],
writer: &mut W,
) -> Result<(u32, usize)>
pub fn concatenate_streaming<W: Write>( sources: &[(&[u8], u32)], writer: &mut W, ) -> Result<(u32, usize)>
Streaming merge: write blocks directly to output writer (bounded memory).
Parses only footer + skip_list from each source (no data copy),
streams block data with patched 8-byte prefixes directly to writer,
then appends merged skip_list + footer.
Memory per term: O(total_blocks × 16) for skip entries only. Block data flows source mmap → output writer without buffering.
Returns (doc_count, bytes_written).
Sourcepub fn iterator(&self) -> BlockPostingIterator<'_>
pub fn iterator(&self) -> BlockPostingIterator<'_>
Create an iterator with skip support
Sourcepub fn into_iterator(self) -> BlockPostingIterator<'static>
pub fn into_iterator(self) -> BlockPostingIterator<'static>
Create an owned iterator that doesn’t borrow self
Trait Implementations§
Source§impl Clone for BlockPostingList
impl Clone for BlockPostingList
Source§fn clone(&self) -> BlockPostingList
fn clone(&self) -> BlockPostingList
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for BlockPostingList
impl RefUnwindSafe for BlockPostingList
impl Send for BlockPostingList
impl Sync for BlockPostingList
impl Unpin for BlockPostingList
impl UnwindSafe for BlockPostingList
Blanket Implementations§
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.