pub struct Storage { /* private fields */ }Implementations§
Source§impl Storage
impl Storage
pub fn new(cache_dir: &Path) -> Result<Self>
pub fn open_space(&self, name: &str) -> Result<()>
pub fn close_space(&self, name: &str) -> Result<()>
pub fn create_space(&self, name: &str, description: Option<&str>) -> Result<i64>
pub fn get_space(&self, name: &str) -> Result<SpaceRow>
pub fn get_space_by_id(&self, id: i64) -> Result<SpaceRow>
pub fn list_spaces(&self) -> Result<Vec<SpaceRow>>
pub fn find_space_for_collection( &self, collection: &str, ) -> Result<SpaceResolution>
pub fn delete_space(&self, name: &str) -> Result<()>
pub fn rename_space(&self, old: &str, new: &str) -> Result<()>
pub fn update_space_description( &self, name: &str, description: &str, ) -> Result<()>
pub fn create_collection( &self, space_id: i64, name: &str, path: &Path, description: Option<&str>, extensions: Option<&[String]>, ) -> Result<i64>
pub fn get_collection(&self, space_id: i64, name: &str) -> Result<CollectionRow>
pub fn get_collection_by_id(&self, id: i64) -> Result<CollectionRow>
pub fn list_collections( &self, space_id: Option<i64>, ) -> Result<Vec<CollectionRow>>
pub fn count_collections_in_space(&self, space_id: i64) -> Result<usize>
pub fn delete_collection(&self, space_id: i64, name: &str) -> Result<()>
pub fn rename_collection( &self, space_id: i64, old: &str, new: &str, ) -> Result<()>
pub fn update_collection_description( &self, space_id: i64, name: &str, desc: &str, ) -> Result<()>
pub fn update_collection_timestamp(&self, collection_id: i64) -> Result<()>
pub fn upsert_document( &self, collection_id: i64, path: &str, title: &str, title_source: DocumentTitleSource, hash: &str, modified: &str, ) -> Result<i64>
pub fn get_document_by_path( &self, collection_id: i64, path: &str, ) -> Result<Option<DocumentRow>>
pub fn get_document_by_id(&self, id: i64) -> Result<DocumentRow>
pub fn get_documents_by_ids(&self, ids: &[i64]) -> Result<Vec<DocumentRow>>
pub fn refresh_document_activity( &self, doc_id: i64, modified: &str, ) -> Result<()>
pub fn list_documents( &self, collection_id: i64, active_only: bool, ) -> Result<Vec<DocumentRow>>
pub fn list_collection_file_rows( &self, collection_id: i64, active_only: bool, ) -> Result<Vec<FileListRow>>
pub fn get_document_by_hash_prefix( &self, prefix: &str, ) -> Result<Vec<DocumentRow>>
pub fn deactivate_document(&self, doc_id: i64) -> Result<()>
pub fn reactivate_document(&self, doc_id: i64) -> Result<()>
pub fn reap_documents(&self, older_than_days: u32) -> Result<Vec<i64>>
pub fn list_reapable_documents( &self, older_than_days: u32, ) -> Result<Vec<ReapableDocument>>
pub fn list_reapable_documents_in_space( &self, older_than_days: u32, space_id: i64, ) -> Result<Vec<ReapableDocument>>
pub fn list_reapable_documents_in_collections( &self, older_than_days: u32, collection_ids: &[i64], ) -> Result<Vec<ReapableDocument>>
pub fn delete_documents(&self, doc_ids: &[i64]) -> Result<()>
pub fn insert_chunks( &self, doc_id: i64, chunks: &[ChunkInsert], ) -> Result<Vec<i64>>
pub fn delete_chunks_for_document(&self, doc_id: i64) -> Result<Vec<i64>>
pub fn get_chunks_for_document(&self, doc_id: i64) -> Result<Vec<ChunkRow>>
pub fn get_chunks_for_documents( &self, doc_ids: &[i64], ) -> Result<HashMap<i64, Vec<ChunkRow>>>
pub fn get_chunks_for_document_seq_ranges( &self, ranges: &[(i64, i32, i32)], ) -> Result<HashMap<i64, Vec<ChunkRow>>>
pub fn get_chunks(&self, chunk_ids: &[i64]) -> Result<Vec<ChunkRow>>
pub fn get_active_search_scope_summary_in_collections( &self, collection_ids: &[i64], ) -> Result<SearchScopeSummary>
pub fn count_active_chunks_in_collections( &self, collection_ids: &[i64], ) -> Result<usize>
pub fn has_inactive_documents_in_collections( &self, collection_ids: &[i64], ) -> Result<bool>
pub fn get_active_chunk_ids_in_collections( &self, collection_ids: &[i64], ) -> Result<Vec<i64>>
pub fn replace_document_generation( &self, replacement: DocumentGenerationReplace<'_>, ) -> Result<DocumentGenerationReplaceResult>
pub fn put_document_text( &self, doc_id: i64, extractor_key: &str, source_hash: &str, text_hash: &str, generation_key: &str, text: &str, ) -> Result<()>
pub fn get_document_text(&self, doc_id: i64) -> Result<DocumentTextRow>
pub fn get_document_texts( &self, doc_ids: &[i64], ) -> Result<HashMap<i64, DocumentTextRow>>
pub fn get_existing_document_texts( &self, doc_ids: &[i64], ) -> Result<HashMap<i64, DocumentTextRow>>
pub fn has_document_text(&self, doc_id: i64) -> Result<bool>
pub fn has_current_document_text( &self, doc_id: i64, generation_key: &str, ) -> Result<bool>
pub fn get_document_text_generation_keys( &self, doc_ids: &[i64], ) -> Result<HashMap<i64, String>>
pub fn get_document_text_extractors( &self, doc_ids: &[i64], ) -> Result<HashMap<i64, String>>
pub fn get_canonical_chunk_texts( &self, chunk_ids: &[i64], ) -> Result<HashMap<i64, String>>
pub fn get_chunk_text(&self, chunk_id: i64) -> Result<ChunkTextRow>
pub fn insert_embeddings(&self, entries: &[(i64, &str)]) -> Result<()>
pub fn get_unembedded_chunks( &self, model: &str, after_chunk_id: i64, limit: usize, ) -> Result<Vec<EmbedRecord>>
pub fn get_unembedded_chunks_in_space( &self, model: &str, space_id: i64, after_chunk_id: i64, limit: usize, ) -> Result<Vec<EmbedRecord>>
pub fn get_unembedded_chunks_in_collections( &self, model: &str, collection_ids: &[i64], after_chunk_id: i64, limit: usize, ) -> Result<Vec<EmbedRecord>>
pub fn delete_embeddings_for_model(&self, model: &str) -> Result<usize>
pub fn delete_embeddings_for_space(&self, space_id: i64) -> Result<usize>
pub fn list_embedding_models_in_space( &self, space_id: i64, ) -> Result<Vec<String>>
pub fn count_embeddings(&self) -> Result<usize>
pub fn index_tantivy(&self, space: &str, entries: &[TantivyEntry]) -> Result<()>
pub fn delete_tantivy(&self, space: &str, chunk_ids: &[i64]) -> Result<()>
pub fn delete_tantivy_by_doc(&self, space: &str, doc_id: i64) -> Result<()>
pub fn query_bm25( &self, space: &str, query: &str, fields: &[(&str, f32)], limit: usize, ) -> Result<Vec<BM25Hit>>
pub fn query_bm25_in_documents( &self, space: &str, query: &str, fields: &[(&str, f32)], document_ids: &[i64], limit: usize, ) -> Result<Vec<BM25Hit>>
pub fn commit_tantivy(&self, space: &str) -> Result<()>
pub fn insert_usearch( &self, space: &str, key: i64, vector: &[f32], ) -> Result<()>
pub fn batch_insert_usearch( &self, space: &str, entries: &[(i64, &[f32])], ) -> Result<()>
pub fn delete_usearch(&self, space: &str, keys: &[i64]) -> Result<()>
pub fn query_dense( &self, space: &str, vector: &[f32], limit: usize, ) -> Result<Vec<DenseHit>>
pub fn query_dense_in_chunks( &self, space: &str, vector: &[f32], chunk_ids: &[i64], limit: usize, ) -> Result<Vec<DenseHit>>
pub fn count_usearch(&self, space: &str) -> Result<usize>
pub fn clear_usearch(&self, space: &str) -> Result<()>
pub fn get_fts_dirty_documents(&self) -> Result<Vec<FtsDirtyRecord>>
pub fn get_fts_dirty_documents_in_space( &self, space_id: i64, ) -> Result<Vec<FtsDirtyRecord>>
pub fn get_fts_dirty_documents_in_collections( &self, collection_ids: &[i64], ) -> Result<Vec<FtsDirtyRecord>>
pub fn batch_clear_fts_dirty(&self, doc_ids: &[i64]) -> Result<()>
pub fn count_documents_in_collection( &self, collection_id: i64, active_only: bool, ) -> Result<usize>
pub fn count_chunks_in_collection(&self, collection_id: i64) -> Result<usize>
pub fn count_embedded_chunks_in_collection( &self, collection_id: i64, ) -> Result<usize>
pub fn count_documents(&self, space_id: Option<i64>) -> Result<usize>
pub fn count_chunks(&self, space_id: Option<i64>) -> Result<usize>
pub fn count_embedded_chunks(&self, space_id: Option<i64>) -> Result<usize>
pub fn disk_usage(&self) -> Result<DiskUsage>
Auto Trait Implementations§
impl !Freeze for Storage
impl RefUnwindSafe for Storage
impl Send for Storage
impl Sync for Storage
impl Unpin for Storage
impl UnsafeUnpin for Storage
impl UnwindSafe for Storage
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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