pub struct InMemoryDocumentStore { /* private fields */ }Expand description
In-memory document store
Q5: uses tokio::sync::RwLock (consistent with InMemoryVectorStore), methods .await
directly without blocking the executor; and there are no synchronous _blocking methods
called from async contexts, so there is no blocking_read/write panic constraint.
Implementations§
Source§impl InMemoryDocumentStore
impl InMemoryDocumentStore
Sourcepub fn new() -> InMemoryDocumentStore
pub fn new() -> InMemoryDocumentStore
Creates a new in-memory document store
Trait Implementations§
Source§impl Default for InMemoryDocumentStore
impl Default for InMemoryDocumentStore
Source§fn default() -> InMemoryDocumentStore
fn default() -> InMemoryDocumentStore
Returns the “default value” for a type. Read more
Source§impl DocumentStore for InMemoryDocumentStore
impl DocumentStore for InMemoryDocumentStore
Source§fn add_document<'life0, 'async_trait>(
&'life0 self,
document: Document,
) -> Pin<Box<dyn Future<Output = Result<String, VectorStoreError>> + Send + 'async_trait>>where
'life0: 'async_trait,
InMemoryDocumentStore: 'async_trait,
fn add_document<'life0, 'async_trait>(
&'life0 self,
document: Document,
) -> Pin<Box<dyn Future<Output = Result<String, VectorStoreError>> + Send + 'async_trait>>where
'life0: 'async_trait,
InMemoryDocumentStore: 'async_trait,
Adds a document
Source§fn add_documents<'life0, 'async_trait>(
&'life0 self,
documents: Vec<Document>,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>, VectorStoreError>> + Send + 'async_trait>>where
'life0: 'async_trait,
InMemoryDocumentStore: 'async_trait,
fn add_documents<'life0, 'async_trait>(
&'life0 self,
documents: Vec<Document>,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>, VectorStoreError>> + Send + 'async_trait>>where
'life0: 'async_trait,
InMemoryDocumentStore: 'async_trait,
Adds documents in bulk
Source§fn get_document<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Document>, VectorStoreError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemoryDocumentStore: 'async_trait,
fn get_document<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Document>, VectorStoreError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemoryDocumentStore: 'async_trait,
Gets a document
Source§fn delete_document<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), VectorStoreError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemoryDocumentStore: 'async_trait,
fn delete_document<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), VectorStoreError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemoryDocumentStore: 'async_trait,
Deletes a document
Auto Trait Implementations§
impl !RefUnwindSafe for InMemoryDocumentStore
impl !UnwindSafe for InMemoryDocumentStore
impl Freeze for InMemoryDocumentStore
impl Send for InMemoryDocumentStore
impl Sync for InMemoryDocumentStore
impl Unpin for InMemoryDocumentStore
impl UnsafeUnpin for InMemoryDocumentStore
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