pub struct PostingList { /* private fields */ }Expand description
A posting list for a single token.
Implementations§
Source§impl PostingList
impl PostingList
Sourcepub fn from_entries(entries: Vec<PostingEntry>) -> Self
pub fn from_entries(entries: Vec<PostingEntry>) -> Self
Create a posting list from entries.
Sourcepub fn entries(&self) -> &[PostingEntry]
pub fn entries(&self) -> &[PostingEntry]
Get the entries.
Sourcepub fn max_weight(&self) -> f32
pub fn max_weight(&self) -> f32
Get the maximum weight.
Sourcepub fn add(&mut self, entry: PostingEntry)
pub fn add(&mut self, entry: PostingEntry)
Add an entry, maintaining sort order.
Sourcepub fn to_bytes(&self) -> Vec<u8> ⓘ
pub fn to_bytes(&self) -> Vec<u8> ⓘ
Serialize to bytes.
Format: [count: u32][max_weight: f32][(point_id: u64, weight: f32), …]
Sourcepub fn from_bytes(bytes: &[u8]) -> Result<Self, VectorError>
pub fn from_bytes(bytes: &[u8]) -> Result<Self, VectorError>
Deserialize from bytes.
Trait Implementations§
Source§impl Clone for PostingList
impl Clone for PostingList
Source§fn clone(&self) -> PostingList
fn clone(&self) -> PostingList
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 moreSource§impl Debug for PostingList
impl Debug for PostingList
Source§impl Default for PostingList
impl Default for PostingList
Source§fn default() -> PostingList
fn default() -> PostingList
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for PostingList
impl RefUnwindSafe for PostingList
impl Send for PostingList
impl Sync for PostingList
impl Unpin for PostingList
impl UnwindSafe for PostingList
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