pub struct ColdStore {
codebook: PqCodebook,
entries: Vec<ColdEntry>,
}Expand description
Cold store using PQ-encoded vectors.
Fields§
§codebook: PqCodebook§entries: Vec<ColdEntry>Encoded vectors: (entity_id, space_id, timestamp, pq_codes).
Implementations§
Source§impl ColdStore
impl ColdStore
Sourcepub fn new(codebook: PqCodebook) -> Self
pub fn new(codebook: PqCodebook) -> Self
Create a cold store with a trained codebook.
Sourcepub fn put(
&mut self,
entity_id: u64,
space_id: u32,
timestamp: i64,
vector: &[f32],
)
pub fn put( &mut self, entity_id: u64, space_id: u32, timestamp: i64, vector: &[f32], )
Store a vector (encodes it with PQ).
Sourcepub fn get(
&self,
entity_id: u64,
space_id: u32,
timestamp: i64,
) -> Option<Vec<f32>>
pub fn get( &self, entity_id: u64, space_id: u32, timestamp: i64, ) -> Option<Vec<f32>>
Retrieve and decode a vector.
Sourcepub fn storage_bytes(&self) -> usize
pub fn storage_bytes(&self) -> usize
Storage size in bytes (codes only, no overhead).
Sourcepub fn codebook(&self) -> &PqCodebook
pub fn codebook(&self) -> &PqCodebook
Access the codebook.
Auto Trait Implementations§
impl Freeze for ColdStore
impl RefUnwindSafe for ColdStore
impl Send for ColdStore
impl Sync for ColdStore
impl Unpin for ColdStore
impl UnwindSafe for ColdStore
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