pub struct DiskStorage { /* private fields */ }Expand description
File-based storage implementation.
Implementations§
Trait Implementations§
Source§impl Storage for DiskStorage
impl Storage for DiskStorage
Source§fn init_workspace(
&self,
workspace_id: &WorkspaceId,
root_path: &PathBuf,
) -> Result<()>
fn init_workspace( &self, workspace_id: &WorkspaceId, root_path: &PathBuf, ) -> Result<()>
Initialize storage for a workspace.
Source§fn workspace_exists(&self, workspace_id: &WorkspaceId) -> bool
fn workspace_exists(&self, workspace_id: &WorkspaceId) -> bool
Check if a workspace exists.
Source§fn load_workspace_metadata(
&self,
workspace_id: &WorkspaceId,
) -> Result<WorkspaceMetadata>
fn load_workspace_metadata( &self, workspace_id: &WorkspaceId, ) -> Result<WorkspaceMetadata>
Load workspace metadata.
Source§fn save_workspace_metadata(
&self,
workspace_id: &WorkspaceId,
metadata: &WorkspaceMetadata,
) -> Result<()>
fn save_workspace_metadata( &self, workspace_id: &WorkspaceId, metadata: &WorkspaceMetadata, ) -> Result<()>
Save workspace metadata.
Source§fn save_documents(
&self,
workspace_id: &WorkspaceId,
documents: &[Document],
) -> Result<()>
fn save_documents( &self, workspace_id: &WorkspaceId, documents: &[Document], ) -> Result<()>
Save documents for a workspace.
Source§fn load_documents(&self, workspace_id: &WorkspaceId) -> Result<Vec<Document>>
fn load_documents(&self, workspace_id: &WorkspaceId) -> Result<Vec<Document>>
Load all documents for a workspace.
Source§fn save_chunks(
&self,
workspace_id: &WorkspaceId,
chunks: &[Chunk],
) -> Result<()>
fn save_chunks( &self, workspace_id: &WorkspaceId, chunks: &[Chunk], ) -> Result<()>
Save chunks for a workspace.
Source§fn load_chunks(&self, workspace_id: &WorkspaceId) -> Result<Vec<Chunk>>
fn load_chunks(&self, workspace_id: &WorkspaceId) -> Result<Vec<Chunk>>
Load all chunks for a workspace.
Source§fn save_embeddings(
&self,
workspace_id: &WorkspaceId,
embeddings: &[(String, Vec<f32>)],
) -> Result<()>
fn save_embeddings( &self, workspace_id: &WorkspaceId, embeddings: &[(String, Vec<f32>)], ) -> Result<()>
Save embeddings for chunks.
Source§fn load_embeddings(
&self,
workspace_id: &WorkspaceId,
) -> Result<Vec<(String, Vec<f32>)>>
fn load_embeddings( &self, workspace_id: &WorkspaceId, ) -> Result<Vec<(String, Vec<f32>)>>
Load embeddings for a workspace.
Source§fn tantivy_index_path(&self, workspace_id: &WorkspaceId) -> PathBuf
fn tantivy_index_path(&self, workspace_id: &WorkspaceId) -> PathBuf
Get the path to the tantivy index directory.
Source§fn vector_index_path(&self, workspace_id: &WorkspaceId) -> PathBuf
fn vector_index_path(&self, workspace_id: &WorkspaceId) -> PathBuf
Get the path to the vector index.
Source§fn delete_workspace(&self, workspace_id: &WorkspaceId) -> Result<()>
fn delete_workspace(&self, workspace_id: &WorkspaceId) -> Result<()>
Delete a workspace and all its data.
Source§fn list_workspaces(&self) -> Result<Vec<WorkspaceId>>
fn list_workspaces(&self) -> Result<Vec<WorkspaceId>>
List all stored workspaces.
Source§fn get_workspace_stats(
&self,
workspace_id: &WorkspaceId,
) -> Result<WorkspaceStats>
fn get_workspace_stats( &self, workspace_id: &WorkspaceId, ) -> Result<WorkspaceStats>
Get workspace statistics.
Auto Trait Implementations§
impl !Freeze for DiskStorage
impl !RefUnwindSafe for DiskStorage
impl Send for DiskStorage
impl Sync for DiskStorage
impl Unpin for DiskStorage
impl UnwindSafe for DiskStorage
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>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<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>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> 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)
Convert
&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)
Convert
&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> 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