pub trait StorageTx {
Show 13 methods
// Required methods
fn add_document(&mut self, doc: &Document) -> Result<()>;
fn set_document_path(&mut self, doc_id: &str, path: &str) -> Result<()>;
fn delete_document(&mut self, doc_id: &str) -> Result<()>;
fn add_chunks(&mut self, chunks: &[Chunk]) -> Result<()>;
fn add_chunk_documents(
&mut self,
chunk_ids: &[String],
doc_id: &str,
) -> Result<()>;
fn delete_chunks_by_doc(&mut self, doc_id: &str) -> Result<()>;
fn add_vectors(
&mut self,
chunk_ids: &[String],
embeddings: &[Vec<f32>],
) -> Result<()>;
fn add_fts_chunks(
&mut self,
chunk_ids: &[String],
tokenized_texts: &[String],
) -> Result<()>;
fn set_model_version(
&mut self,
role: ModelRole,
version: &ModelSpec,
) -> Result<()>;
fn add_collection(&mut self, name: &str, path: &str) -> Result<()>;
fn delete_collection(&mut self, name: &str) -> Result<()>;
fn clear_collections(&mut self) -> Result<()>;
fn commit(&mut self) -> Result<()>;
}Expand description
Atomic write transaction over the indexed tables. All mutations flow through this trait so a re-index / re-embed failure cannot leave the store half-written.
Required Methods§
fn add_document(&mut self, doc: &Document) -> Result<()>
fn set_document_path(&mut self, doc_id: &str, path: &str) -> Result<()>
fn delete_document(&mut self, doc_id: &str) -> Result<()>
fn add_chunks(&mut self, chunks: &[Chunk]) -> Result<()>
fn add_chunk_documents( &mut self, chunk_ids: &[String], doc_id: &str, ) -> Result<()>
fn delete_chunks_by_doc(&mut self, doc_id: &str) -> Result<()>
fn add_vectors( &mut self, chunk_ids: &[String], embeddings: &[Vec<f32>], ) -> Result<()>
fn add_fts_chunks( &mut self, chunk_ids: &[String], tokenized_texts: &[String], ) -> Result<()>
fn set_model_version( &mut self, role: ModelRole, version: &ModelSpec, ) -> Result<()>
fn add_collection(&mut self, name: &str, path: &str) -> Result<()>
fn delete_collection(&mut self, name: &str) -> Result<()>
fn clear_collections(&mut self) -> Result<()>
fn commit(&mut self) -> Result<()>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".