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
Sourcepub fn deserialize<R: Read>(reader: &mut R) -> Result<Self>
pub fn deserialize<R: Read>(reader: &mut R) -> Result<Self>
Deserialize
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)>
pub fn block_info( &self, block_idx: usize, ) -> Option<(DocId, DocId, usize, usize)>
Get block metadata: (base_doc_id, last_doc_id, data_offset, data_len)
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 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
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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