Skip to main content

Storage

Struct Storage 

Source
pub struct Storage { /* private fields */ }

Implementations§

Source§

impl Storage

Source

pub fn new(cache_dir: &Path) -> Result<Self>

Source

pub fn open_space(&self, name: &str) -> Result<()>

Source

pub fn close_space(&self, name: &str) -> Result<()>

Source

pub fn create_space(&self, name: &str, description: Option<&str>) -> Result<i64>

Source

pub fn get_space(&self, name: &str) -> Result<SpaceRow>

Source

pub fn get_space_by_id(&self, id: i64) -> Result<SpaceRow>

Source

pub fn list_spaces(&self) -> Result<Vec<SpaceRow>>

Source

pub fn find_space_for_collection( &self, collection: &str, ) -> Result<SpaceResolution>

Source

pub fn delete_space(&self, name: &str) -> Result<()>

Source

pub fn rename_space(&self, old: &str, new: &str) -> Result<()>

Source

pub fn update_space_description( &self, name: &str, description: &str, ) -> Result<()>

Source

pub fn create_collection( &self, space_id: i64, name: &str, path: &Path, description: Option<&str>, extensions: Option<&[String]>, ) -> Result<i64>

Source

pub fn get_collection(&self, space_id: i64, name: &str) -> Result<CollectionRow>

Source

pub fn get_collection_by_id(&self, id: i64) -> Result<CollectionRow>

Source

pub fn list_collections( &self, space_id: Option<i64>, ) -> Result<Vec<CollectionRow>>

Source

pub fn count_collections_in_space(&self, space_id: i64) -> Result<usize>

Source

pub fn delete_collection(&self, space_id: i64, name: &str) -> Result<()>

Source

pub fn rename_collection( &self, space_id: i64, old: &str, new: &str, ) -> Result<()>

Source

pub fn update_collection_description( &self, space_id: i64, name: &str, desc: &str, ) -> Result<()>

Source

pub fn update_collection_timestamp(&self, collection_id: i64) -> Result<()>

Source

pub fn upsert_document( &self, collection_id: i64, path: &str, title: &str, title_source: DocumentTitleSource, hash: &str, modified: &str, ) -> Result<i64>

Source

pub fn get_document_by_path( &self, collection_id: i64, path: &str, ) -> Result<Option<DocumentRow>>

Source

pub fn get_document_by_id(&self, id: i64) -> Result<DocumentRow>

Source

pub fn get_documents_by_ids(&self, ids: &[i64]) -> Result<Vec<DocumentRow>>

Source

pub fn refresh_document_activity( &self, doc_id: i64, modified: &str, ) -> Result<()>

Source

pub fn list_documents( &self, collection_id: i64, active_only: bool, ) -> Result<Vec<DocumentRow>>

Source

pub fn list_collection_file_rows( &self, collection_id: i64, active_only: bool, ) -> Result<Vec<FileListRow>>

Source

pub fn get_document_by_hash_prefix( &self, prefix: &str, ) -> Result<Vec<DocumentRow>>

Source

pub fn deactivate_document(&self, doc_id: i64) -> Result<()>

Source

pub fn reactivate_document(&self, doc_id: i64) -> Result<()>

Source

pub fn reap_documents(&self, older_than_days: u32) -> Result<Vec<i64>>

Source

pub fn list_reapable_documents( &self, older_than_days: u32, ) -> Result<Vec<ReapableDocument>>

Source

pub fn list_reapable_documents_in_space( &self, older_than_days: u32, space_id: i64, ) -> Result<Vec<ReapableDocument>>

Source

pub fn list_reapable_documents_in_collections( &self, older_than_days: u32, collection_ids: &[i64], ) -> Result<Vec<ReapableDocument>>

Source

pub fn delete_documents(&self, doc_ids: &[i64]) -> Result<()>

Source

pub fn insert_chunks( &self, doc_id: i64, chunks: &[ChunkInsert], ) -> Result<Vec<i64>>

Source

pub fn delete_chunks_for_document(&self, doc_id: i64) -> Result<Vec<i64>>

Source

pub fn get_chunks_for_document(&self, doc_id: i64) -> Result<Vec<ChunkRow>>

Source

pub fn get_chunks_for_documents( &self, doc_ids: &[i64], ) -> Result<HashMap<i64, Vec<ChunkRow>>>

Source

pub fn get_chunks_for_document_seq_ranges( &self, ranges: &[(i64, i32, i32)], ) -> Result<HashMap<i64, Vec<ChunkRow>>>

Source

pub fn get_chunks(&self, chunk_ids: &[i64]) -> Result<Vec<ChunkRow>>

Source

pub fn get_active_search_scope_summary_in_collections( &self, collection_ids: &[i64], ) -> Result<SearchScopeSummary>

Source

pub fn count_active_chunks_in_collections( &self, collection_ids: &[i64], ) -> Result<usize>

Source

pub fn has_inactive_documents_in_collections( &self, collection_ids: &[i64], ) -> Result<bool>

Source

pub fn get_active_chunk_ids_in_collections( &self, collection_ids: &[i64], ) -> Result<Vec<i64>>

Source

pub fn replace_document_generation( &self, replacement: DocumentGenerationReplace<'_>, ) -> Result<DocumentGenerationReplaceResult>

Source

pub fn put_document_text( &self, doc_id: i64, extractor_key: &str, source_hash: &str, text_hash: &str, generation_key: &str, text: &str, ) -> Result<()>

Source

pub fn get_document_text(&self, doc_id: i64) -> Result<DocumentTextRow>

Source

pub fn get_document_texts( &self, doc_ids: &[i64], ) -> Result<HashMap<i64, DocumentTextRow>>

Source

pub fn get_existing_document_texts( &self, doc_ids: &[i64], ) -> Result<HashMap<i64, DocumentTextRow>>

Source

pub fn has_document_text(&self, doc_id: i64) -> Result<bool>

Source

pub fn has_current_document_text( &self, doc_id: i64, generation_key: &str, ) -> Result<bool>

Source

pub fn get_document_text_generation_keys( &self, doc_ids: &[i64], ) -> Result<HashMap<i64, String>>

Source

pub fn get_document_text_extractors( &self, doc_ids: &[i64], ) -> Result<HashMap<i64, String>>

Source

pub fn get_canonical_chunk_texts( &self, chunk_ids: &[i64], ) -> Result<HashMap<i64, String>>

Source

pub fn get_chunk_text(&self, chunk_id: i64) -> Result<ChunkTextRow>

Source

pub fn insert_embeddings(&self, entries: &[(i64, &str)]) -> Result<()>

Source

pub fn get_unembedded_chunks( &self, model: &str, after_chunk_id: i64, limit: usize, ) -> Result<Vec<EmbedRecord>>

Source

pub fn get_unembedded_chunks_in_space( &self, model: &str, space_id: i64, after_chunk_id: i64, limit: usize, ) -> Result<Vec<EmbedRecord>>

Source

pub fn get_unembedded_chunks_in_collections( &self, model: &str, collection_ids: &[i64], after_chunk_id: i64, limit: usize, ) -> Result<Vec<EmbedRecord>>

Source

pub fn delete_embeddings_for_model(&self, model: &str) -> Result<usize>

Source

pub fn delete_embeddings_for_space(&self, space_id: i64) -> Result<usize>

Source

pub fn list_embedding_models_in_space( &self, space_id: i64, ) -> Result<Vec<String>>

Source

pub fn count_embeddings(&self) -> Result<usize>

Source

pub fn index_tantivy(&self, space: &str, entries: &[TantivyEntry]) -> Result<()>

Source

pub fn delete_tantivy(&self, space: &str, chunk_ids: &[i64]) -> Result<()>

Source

pub fn delete_tantivy_by_doc(&self, space: &str, doc_id: i64) -> Result<()>

Source

pub fn query_bm25( &self, space: &str, query: &str, fields: &[(&str, f32)], limit: usize, ) -> Result<Vec<BM25Hit>>

Source

pub fn query_bm25_in_documents( &self, space: &str, query: &str, fields: &[(&str, f32)], document_ids: &[i64], limit: usize, ) -> Result<Vec<BM25Hit>>

Source

pub fn commit_tantivy(&self, space: &str) -> Result<()>

Source

pub fn insert_usearch( &self, space: &str, key: i64, vector: &[f32], ) -> Result<()>

Source

pub fn batch_insert_usearch( &self, space: &str, entries: &[(i64, &[f32])], ) -> Result<()>

Source

pub fn delete_usearch(&self, space: &str, keys: &[i64]) -> Result<()>

Source

pub fn query_dense( &self, space: &str, vector: &[f32], limit: usize, ) -> Result<Vec<DenseHit>>

Source

pub fn query_dense_in_chunks( &self, space: &str, vector: &[f32], chunk_ids: &[i64], limit: usize, ) -> Result<Vec<DenseHit>>

Source

pub fn count_usearch(&self, space: &str) -> Result<usize>

Source

pub fn clear_usearch(&self, space: &str) -> Result<()>

Source

pub fn get_fts_dirty_documents(&self) -> Result<Vec<FtsDirtyRecord>>

Source

pub fn get_fts_dirty_documents_in_space( &self, space_id: i64, ) -> Result<Vec<FtsDirtyRecord>>

Source

pub fn get_fts_dirty_documents_in_collections( &self, collection_ids: &[i64], ) -> Result<Vec<FtsDirtyRecord>>

Source

pub fn batch_clear_fts_dirty(&self, doc_ids: &[i64]) -> Result<()>

Source

pub fn count_documents_in_collection( &self, collection_id: i64, active_only: bool, ) -> Result<usize>

Source

pub fn count_chunks_in_collection(&self, collection_id: i64) -> Result<usize>

Source

pub fn count_embedded_chunks_in_collection( &self, collection_id: i64, ) -> Result<usize>

Source

pub fn count_documents(&self, space_id: Option<i64>) -> Result<usize>

Source

pub fn count_chunks(&self, space_id: Option<i64>) -> Result<usize>

Source

pub fn count_embedded_chunks(&self, space_id: Option<i64>) -> Result<usize>

Source

pub fn disk_usage(&self) -> Result<DiskUsage>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> Downcast for T
where T: Any,

Source§

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>

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)

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)

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
where T: Any + Send,

Source§

fn into_any_send(self: Box<T>) -> Box<dyn Any + Send>

Converts Box<Trait> (where Trait: DowncastSend) to Box<dyn Any + Send>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_sync(self: Box<T>) -> Box<dyn Any + Sync + Send>

Converts Box<Trait> (where Trait: DowncastSync) to Box<dyn Any + Send + Sync>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

Converts Arc<Trait> (where Trait: DowncastSync) to Arc<Any>, which can then be downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> Fruit for T
where T: Send + Downcast,