pub struct Storage { /* private fields */ }Expand description
Simple storage repository for text data
Implementations§
Source§impl Storage
 
impl Storage
Sourcepub async fn store(
    &self,
    content: &str,
    context: String,
    summary: String,
    tags: Option<Vec<String>>,
) -> Result<Uuid>
 
pub async fn store( &self, content: &str, context: String, summary: String, tags: Option<Vec<String>>, ) -> Result<Uuid>
Store text with context and summary (deduplication by hash)
Sourcepub async fn store_chunk(
    &self,
    content: &str,
    context: String,
    summary: String,
    tags: Option<Vec<String>>,
    chunk_index: i32,
    total_chunks: i32,
    parent_id: Uuid,
) -> Result<Uuid>
 
pub async fn store_chunk( &self, content: &str, context: String, summary: String, tags: Option<Vec<String>>, chunk_index: i32, total_chunks: i32, parent_id: Uuid, ) -> Result<Uuid>
Store a chunk with parent reference
Sourcepub async fn get_chunks(&self, parent_id: Uuid) -> Result<Vec<Memory>>
 
pub async fn get_chunks(&self, parent_id: Uuid) -> Result<Vec<Memory>>
Get all chunks for a parent document, ordered by chunk index
Sourcepub async fn stats(&self) -> Result<StorageStats>
 
pub async fn stats(&self) -> Result<StorageStats>
Get basic storage statistics
Sourcepub async fn list_recent(&self, limit: i64) -> Result<Vec<Memory>>
 
pub async fn list_recent(&self, limit: i64) -> Result<Vec<Memory>>
List recent memories (for basic browsing)
Sourcepub async fn find_similar_content(
    &self,
    content_hash: &str,
    limit: i64,
) -> Result<Vec<Memory>>
 
pub async fn find_similar_content( &self, content_hash: &str, limit: i64, ) -> Result<Vec<Memory>>
Find memories with similar content but different contexts Implements transfer appropriate processing - matching content with varying contexts
Auto Trait Implementations§
impl Freeze for Storage
impl !RefUnwindSafe for Storage
impl Send for Storage
impl Sync for Storage
impl Unpin 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> 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