Skip to main content

StorageTx

Trait StorageTx 

Source
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§

Source

fn add_document(&mut self, doc: &Document) -> Result<()>

Source

fn set_document_path(&mut self, doc_id: &str, path: &str) -> Result<()>

Source

fn delete_document(&mut self, doc_id: &str) -> Result<()>

Source

fn add_chunks(&mut self, chunks: &[Chunk]) -> Result<()>

Source

fn add_chunk_documents( &mut self, chunk_ids: &[String], doc_id: &str, ) -> Result<()>

Source

fn delete_chunks_by_doc(&mut self, doc_id: &str) -> Result<()>

Source

fn add_vectors( &mut self, chunk_ids: &[String], embeddings: &[Vec<f32>], ) -> Result<()>

Source

fn add_fts_chunks( &mut self, chunk_ids: &[String], tokenized_texts: &[String], ) -> Result<()>

Source

fn set_model_version( &mut self, role: ModelRole, version: &ModelSpec, ) -> Result<()>

Source

fn add_collection(&mut self, name: &str, path: &str) -> Result<()>

Source

fn delete_collection(&mut self, name: &str) -> Result<()>

Source

fn clear_collections(&mut self) -> Result<()>

Source

fn commit(&mut self) -> Result<()>

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§