Skip to main content

Postings

Trait Postings 

Source
pub trait Postings: Clone {
Show 14 methods // Required methods fn empty() -> Self; fn from_sorted(ids: &[u32]) -> Self; fn insert(&mut self, id: u32); fn contains(&self, id: u32) -> bool; fn len(&self) -> usize; fn and(&self, other: &Self) -> Self; fn or(&self, other: &Self) -> Self; fn and_not(&self, other: &Self) -> Self; fn or_inplace(&mut self, other: &Self); fn to_sorted(&self) -> Vec<u32>; fn native_bytes(&self) -> usize; // Provided methods fn is_empty(&self) -> bool { ... } fn serialize_deltagap(&self) -> Vec<u8> ⓘ { ... } fn deserialize_deltagap(bytes: &[u8]) -> Self where Self: Sized { ... }
}
Expand description

Set-algebra surface the tokenql evaluator and index build against.

Required Methods§

Source

fn empty() -> Self

Source

fn from_sorted(ids: &[u32]) -> Self

Build from strictly-ascending, de-duplicated ids (the natural order of an inverted index).

Source

fn insert(&mut self, id: u32)

Source

fn contains(&self, id: u32) -> bool

Source

fn len(&self) -> usize

Source

fn and(&self, other: &Self) -> Self

∩

Source

fn or(&self, other: &Self) -> Self

∪

Source

fn and_not(&self, other: &Self) -> Self

− (this and-not other)

Source

fn or_inplace(&mut self, other: &Self)

in-place ∪ (the |= of the build/OR loop)

Source

fn to_sorted(&self) -> Vec<u32>

ids in ascending order

Source

fn native_bytes(&self) -> usize

byte size of this set’s native serialized form (memory proxy)

Provided Methods§

Source

fn is_empty(&self) -> bool

Source

fn serialize_deltagap(&self) -> Vec<u8> ⓘ

varint delta-gap of the sorted ids — byte-identical to the TS/Python parts store.

Source

fn deserialize_deltagap(bytes: &[u8]) -> Self
where Self: Sized,

inverse of serialize_deltagap

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§