pub struct PostingBlockHeader {
pub num_entries: u16,
pub bits_per_delta: u8,
pub min_offset: u32,
pub max_offset: u32,
pub max_weight: f32,
}Expand description
Header read from the first 16 bytes of a serialized block.
§Terminology: “offset”
Throughout this module, “offset” means a document’s segment offset ID — its u32 position within a compacted segment. Posting lists are sorted by offset so that block-max pruning can iterate documents in order and merge across dimensions.
§Layout (little-endian, 16 bytes total)
[0..2] num_entries : u16 — number of (offset, weight) pairs
[2] bits_per_delta: u8 — bits per bitpacked delta (0xFF = directory)
[3] _reserved : u8 — reserved for future format versioning
[4..8] min_offset : u32 — smallest doc offset in this block
[8..12] max_offset : u32 — largest doc offset in this block
[12..16] max_weight : f32 — largest weight in this block (for pruning)Fields§
§num_entries: u16Number of (offset, weight) pairs in the block.
bits_per_delta: u8Bits per delta for bitpacked offset decompression.
Set to 0xFF for directory blocks (different body layout).
min_offset: u32Smallest document offset id in this block.
max_offset: u32Largest document offset id in this block.
max_weight: f32Largest weight in this block. Used by block-max pruning to skip entire blocks whose max contribution cannot beat the threshold.
Implementations§
Source§impl PostingBlockHeader
impl PostingBlockHeader
pub fn is_directory(&self) -> bool
Trait Implementations§
Source§impl Clone for PostingBlockHeader
impl Clone for PostingBlockHeader
Source§fn clone(&self) -> PostingBlockHeader
fn clone(&self) -> PostingBlockHeader
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for PostingBlockHeader
Auto Trait Implementations§
impl Freeze for PostingBlockHeader
impl RefUnwindSafe for PostingBlockHeader
impl Send for PostingBlockHeader
impl Sync for PostingBlockHeader
impl Unpin for PostingBlockHeader
impl UnsafeUnpin for PostingBlockHeader
impl UnwindSafe for PostingBlockHeader
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::RequestSource§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>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§unsafe fn to_subset_unchecked(&self) -> SS
unsafe fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.