pub struct PersistentHnswIndex { /* private fields */ }Expand description
Persistent HNSW index with mmap-backed storage
Implementations§
Source§impl PersistentHnswIndex
impl PersistentHnswIndex
Sourcepub fn new(config: IndexConfig) -> Result<Self>
pub fn new(config: IndexConfig) -> Result<Self>
Create a new in-memory index
Sourcepub fn open(path: &Path, config: IndexConfig) -> Result<Self>
pub fn open(path: &Path, config: IndexConfig) -> Result<Self>
Open or create a persistent index at the given path
Sourcepub fn is_valid(&self, current_root: &[u8; 32]) -> bool
pub fn is_valid(&self, current_root: &[u8; 32]) -> bool
Check if index is valid against current state root
Sourcepub fn checkpoint(&mut self, state_root: [u8; 32]) -> Result<()>
pub fn checkpoint(&mut self, state_root: [u8; 32]) -> Result<()>
Update checkpoint to current state root
Sourcepub fn invalidate(&mut self)
pub fn invalidate(&mut self)
Mark index as needing rebuild
Sourcepub fn needs_rebuild(&self) -> bool
pub fn needs_rebuild(&self) -> bool
Check if index needs rebuild
Auto Trait Implementations§
impl Freeze for PersistentHnswIndex
impl !RefUnwindSafe for PersistentHnswIndex
impl Send for PersistentHnswIndex
impl Sync for PersistentHnswIndex
impl Unpin for PersistentHnswIndex
impl UnsafeUnpin for PersistentHnswIndex
impl !UnwindSafe for PersistentHnswIndex
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