pub trait ErasedArchivalMemory: Send + Sync {
// Required methods
fn insert_erased<'a>(
&'a self,
text: &'a str,
metadata: HashMap<String, Value>,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'a>>;
fn search_erased<'a>(
&'a self,
query: &'a str,
top_k: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<ArchivalRecord>>> + Send + 'a>>;
fn delete_erased<'a>(
&'a self,
id: &'a str,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'a>>;
fn count_erased(
&self,
) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + '_>>;
}Expand description
Object-safe wrapper for the ArchivalMemory trait, enabling dynamic
dispatch via Arc<dyn ErasedArchivalMemory>.
Required Methods§
fn insert_erased<'a>( &'a self, text: &'a str, metadata: HashMap<String, Value>, ) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'a>>
fn search_erased<'a>( &'a self, query: &'a str, top_k: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<ArchivalRecord>>> + Send + 'a>>
fn delete_erased<'a>( &'a self, id: &'a str, ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'a>>
fn count_erased( &self, ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + '_>>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".