pub struct StorageService { /* private fields */ }Expand description
High-level storage service with caching and batching
Implementations§
Source§impl StorageService
impl StorageService
pub fn new(storage: Arc<dyn Storage>) -> Self
pub fn with_config( storage: Arc<dyn Storage>, config: StorageServiceConfig, ) -> Self
Sourcepub async fn store_document(&self, document: &Document) -> RragResult<()>
pub async fn store_document(&self, document: &Document) -> RragResult<()>
Store a document
Sourcepub async fn store_chunk(&self, chunk: &DocumentChunk) -> RragResult<()>
pub async fn store_chunk(&self, chunk: &DocumentChunk) -> RragResult<()>
Store a chunk
Sourcepub async fn store_embedding(&self, embedding: &Embedding) -> RragResult<()>
pub async fn store_embedding(&self, embedding: &Embedding) -> RragResult<()>
Store an embedding
Sourcepub async fn get_document(
&self,
document_id: &str,
) -> RragResult<Option<Document>>
pub async fn get_document( &self, document_id: &str, ) -> RragResult<Option<Document>>
Retrieve a document
Sourcepub async fn get_stats(&self) -> RragResult<StorageStats>
pub async fn get_stats(&self) -> RragResult<StorageStats>
Get storage statistics
Sourcepub async fn health_check(&self) -> RragResult<bool>
pub async fn health_check(&self) -> RragResult<bool>
Health check
Auto Trait Implementations§
impl Freeze for StorageService
impl !RefUnwindSafe for StorageService
impl Send for StorageService
impl Sync for StorageService
impl Unpin for StorageService
impl !UnwindSafe for StorageService
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