pub trait Store:
Send
+ Sync
+ 'static {
// Required methods
fn get<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
namespace: &'life1 str,
key: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Item>, StoreError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait;
fn put<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
namespace: &'life1 str,
key: &'life2 str,
value: Value,
index: Option<Vec<String>>,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait;
fn delete<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
namespace: &'life1 str,
key: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait;
fn search<'life0, 'async_trait>(
&'life0 self,
query: SearchQuery,
) -> Pin<Box<dyn Future<Output = Result<SearchResult, StoreError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn list_namespaces<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
prefix: Option<&'life1 str>,
suffix: Option<&'life2 str>,
max_depth: Option<usize>,
limit: Option<usize>,
offset: Option<usize>,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>, StoreError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait;
fn batch<'life0, 'async_trait>(
&'life0 self,
ops: Vec<StoreOp>,
) -> Pin<Box<dyn Future<Output = Result<Vec<StoreResult>, StoreError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
}Expand description
Store trait for cross-thread long-term memory
Provides hierarchical namespace key-value storage independent of checkpoint and shared across all threads and graph executions.
Note: This trait cannot implement Debug as it’s an async trait intended for dynamic dispatch via trait objects.
Required Methods§
Sourcefn get<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
namespace: &'life1 str,
key: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Item>, StoreError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn get<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
namespace: &'life1 str,
key: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Item>, StoreError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Sourcefn put<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
namespace: &'life1 str,
key: &'life2 str,
value: Value,
index: Option<Vec<String>>,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn put<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
namespace: &'life1 str,
key: &'life2 str,
value: Value,
index: Option<Vec<String>>,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Put item into store
§Arguments
namespace- Namespace pathkey- Item key within namespacevalue- Item valueindex- Optional index fields for vector search
Sourcefn delete<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
namespace: &'life1 str,
key: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn delete<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
namespace: &'life1 str,
key: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Sourcefn search<'life0, 'async_trait>(
&'life0 self,
query: SearchQuery,
) -> Pin<Box<dyn Future<Output = Result<SearchResult, StoreError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn search<'life0, 'async_trait>(
&'life0 self,
query: SearchQuery,
) -> Pin<Box<dyn Future<Output = Result<SearchResult, StoreError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Sourcefn list_namespaces<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
prefix: Option<&'life1 str>,
suffix: Option<&'life2 str>,
max_depth: Option<usize>,
limit: Option<usize>,
offset: Option<usize>,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>, StoreError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn list_namespaces<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
prefix: Option<&'life1 str>,
suffix: Option<&'life2 str>,
max_depth: Option<usize>,
limit: Option<usize>,
offset: Option<usize>,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>, StoreError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
List namespaces
§Arguments
prefix- Optional prefix filtersuffix- Optional suffix filtermax_depth- Optional maximum depthlimit- Optional result limitoffset- Optional offset
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".