pub struct FileVectorStore { /* private fields */ }Expand description
File-based vector store with automatic persistence
This implementation provides persistent vector storage using local files. Data is serialized with bincode for performance and compactness.
Implementations§
Source§impl FileVectorStore
impl FileVectorStore
Sourcepub fn new(config: FileConfig) -> Result<Self>
pub fn new(config: FileConfig) -> Result<Self>
Create new file-based vector store
If the file exists, loads data from disk. Otherwise, creates a new empty store. The parent directory will be created if it doesn’t exist.
Trait Implementations§
Source§impl VectorStore for FileVectorStore
impl VectorStore for FileVectorStore
Source§fn upsert<'life0, 'async_trait>(
&'life0 self,
documents: Vec<EmbeddedDocument>,
) -> Pin<Box<dyn Future<Output = Result<UpsertStats>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn upsert<'life0, 'async_trait>(
&'life0 self,
documents: Vec<EmbeddedDocument>,
) -> Pin<Box<dyn Future<Output = Result<UpsertStats>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Insert or update documents in the store Read more
Source§fn search<'life0, 'async_trait>(
&'life0 self,
query_embedding: Vec<f32>,
filter: Option<Filter>,
top_k: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<SearchResult>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn search<'life0, 'async_trait>(
&'life0 self,
query_embedding: Vec<f32>,
filter: Option<Filter>,
top_k: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<SearchResult>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Search for similar vectors Read more
Source§fn delete<'life0, 'async_trait>(
&'life0 self,
ids: Vec<String>,
) -> Pin<Box<dyn Future<Output = Result<DeleteStats>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn delete<'life0, 'async_trait>(
&'life0 self,
ids: Vec<String>,
) -> Pin<Box<dyn Future<Output = Result<DeleteStats>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Delete documents by ID
Source§fn get<'life0, 'async_trait>(
&'life0 self,
ids: Vec<String>,
) -> Pin<Box<dyn Future<Output = Result<Vec<EmbeddedDocument>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get<'life0, 'async_trait>(
&'life0 self,
ids: Vec<String>,
) -> Pin<Box<dyn Future<Output = Result<Vec<EmbeddedDocument>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get documents by ID
Source§fn count<'life0, 'async_trait>(
&'life0 self,
filter: Option<Filter>,
) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn count<'life0, 'async_trait>(
&'life0 self,
filter: Option<Filter>,
) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Count documents, optionally filtered
Source§fn health_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<HealthStatus>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn health_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<HealthStatus>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Check backend health/connectivity
Source§fn backend_name(&self) -> &'static str
fn backend_name(&self) -> &'static str
Get the name of this backend (for logging/debugging)
Source§fn dimensions(&self) -> Option<usize>
fn dimensions(&self) -> Option<usize>
Get configured vector dimensions (if known)
Auto Trait Implementations§
impl !Freeze for FileVectorStore
impl RefUnwindSafe for FileVectorStore
impl Send for FileVectorStore
impl Sync for FileVectorStore
impl Unpin for FileVectorStore
impl UnwindSafe for FileVectorStore
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
Source§impl<T> GetSetFdFlags for T
impl<T> GetSetFdFlags for T
Source§fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
Query the “status” flags for the
self file descriptor.Source§fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
Source§fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
Set the “status” flags for the
self file descriptor. Read moreSource§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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