pub struct DB(/* private fields */);Implementations§
Source§impl DB
impl DB
pub fn open(path: &Path, dim: usize) -> Option<Self>
pub fn add(&self, id: u64, vec: &[f32])
pub fn add_with_meta( &self, id: u64, vec: &[f32], timestamp: i64, importance: f32, context_type: u8, source: Option<&str>, content: Option<&str>, )
pub fn search(&self, query: &[f32], k: usize) -> (Vec<u64>, Vec<f32>)
pub fn search_with_filter( &self, query: &[f32], k: usize, type_filter: Option<u8>, source_filter: Option<&str>, ) -> (Vec<u64>, Vec<f32>)
pub fn save(&self)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DB
impl RefUnwindSafe for DB
impl !Send for DB
impl !Sync for DB
impl Unpin for DB
impl UnwindSafe for DB
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