pub struct FtsPostingCell {
pub cell_id: i64,
pub term: String,
pub entries: Vec<(i64, u32)>,
}Expand description
One FTS posting list cell — either a per-term postings entry or the
single doc-lengths sidecar (when term.is_empty()).
Fields§
§cell_id: i64Sequential id assigned at save time. Acts as the B-Tree slot directory key; never persisted as part of the index logic.
term: StringLowercased ASCII term. Empty on the doc-lengths sidecar.
entries: Vec<(i64, u32)>(rowid, value) pairs. value is term frequency for posting
cells, doc length for the sidecar.
Implementations§
Source§impl FtsPostingCell
impl FtsPostingCell
pub fn posting(cell_id: i64, term: String, entries: Vec<(i64, u32)>) -> Self
Sourcepub fn doc_lengths(cell_id: i64, entries: Vec<(i64, u32)>) -> Self
pub fn doc_lengths(cell_id: i64, entries: Vec<(i64, u32)>) -> Self
Constructs the doc-lengths sidecar cell (term left empty).
Sourcepub fn encode(&self) -> Result<Vec<u8>>
pub fn encode(&self) -> Result<Vec<u8>>
Encodes the cell into a freshly-allocated Vec<u8>. The result
starts with the shared cell_length | kind_tag prefix and is
directly usable as a slot-directory entry on a TableLeaf-style
page.
Sourcepub fn decode(buf: &[u8], pos: usize) -> Result<(FtsPostingCell, usize)>
pub fn decode(buf: &[u8], pos: usize) -> Result<(FtsPostingCell, usize)>
Decodes one cell starting at pos. Returns the cell plus the
total bytes consumed (including the leading length varint).
Sourcepub fn is_doc_lengths(&self) -> bool
pub fn is_doc_lengths(&self) -> bool
True iff this cell is the doc-lengths sidecar.
Trait Implementations§
Source§impl Clone for FtsPostingCell
impl Clone for FtsPostingCell
Source§fn clone(&self) -> FtsPostingCell
fn clone(&self) -> FtsPostingCell
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for FtsPostingCell
impl Debug for FtsPostingCell
Source§impl PartialEq for FtsPostingCell
impl PartialEq for FtsPostingCell
Source§fn eq(&self, other: &FtsPostingCell) -> bool
fn eq(&self, other: &FtsPostingCell) -> bool
self and other values to be equal, and is used by ==.