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§
fn empty() -> Self
Sourcefn from_sorted(ids: &[u32]) -> Self
fn from_sorted(ids: &[u32]) -> Self
Build from strictly-ascending, de-duplicated ids (the natural order of an inverted index).
fn insert(&mut self, id: u32)
fn contains(&self, id: u32) -> bool
fn len(&self) -> usize
Sourcefn or_inplace(&mut self, other: &Self)
fn or_inplace(&mut self, other: &Self)
in-place ∪ (the |= of the build/OR loop)
Sourcefn native_bytes(&self) -> usize
fn native_bytes(&self) -> usize
byte size of this set’s native serialized form (memory proxy)
Provided Methods§
fn is_empty(&self) -> bool
Sourcefn serialize_deltagap(&self) -> Vec<u8> ⓘ
fn serialize_deltagap(&self) -> Vec<u8> ⓘ
varint delta-gap of the sorted ids — byte-identical to the TS/Python parts store.
Sourcefn deserialize_deltagap(bytes: &[u8]) -> Selfwhere
Self: Sized,
fn deserialize_deltagap(bytes: &[u8]) -> Selfwhere
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".