pub struct VectorStore { /* private fields */ }Implementations§
Source§impl VectorStore
impl VectorStore
pub fn open( path: impl AsRef<Path>, dimension: usize, ) -> Result<Self, VectorError>
pub fn in_memory(dimension: usize) -> Result<Self, VectorError>
pub fn from_connection( conn: Connection, dimension: usize, ) -> Result<Self, VectorError>
pub fn dimension(&self) -> usize
pub fn len(&self) -> Result<usize, VectorError>
pub fn is_empty(&self) -> Result<bool, VectorError>
pub fn put( &self, key: &str, model_id: &str, vector: &[f32], ) -> Result<(), VectorError>
pub fn put_batch<'a, I>(&mut self, rows: I) -> Result<(), VectorError>
pub fn get(&self, key: &str) -> Result<Option<Nearest>, VectorError>
pub fn nearest( &self, model_id: &str, query: &[f32], limit: usize, ) -> Result<Vec<Nearest>, VectorError>
pub fn remove(&self, key: &str) -> Result<bool, VectorError>
pub fn clear_model(&self, model_id: &str) -> Result<usize, VectorError>
Auto Trait Implementations§
impl !Freeze for VectorStore
impl !RefUnwindSafe for VectorStore
impl !Sync for VectorStore
impl Send for VectorStore
impl Unpin for VectorStore
impl UnsafeUnpin for VectorStore
impl UnwindSafe for VectorStore
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more