pub trait RecallStore:
Send
+ Sync
+ 'static {
// Required methods
fn ensure_session<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
owner: &'life1 str,
session_id: &'life2 str,
meta: &'life3 SessionMeta,
) -> Pin<Box<dyn Future<Output = Result<(), RecallError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Self: 'async_trait;
fn append<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
owner: &'life1 str,
session_id: &'life2 str,
msg: &'life3 RecallMessage,
) -> Pin<Box<dyn Future<Output = Result<i64, RecallError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Self: 'async_trait;
fn search<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
owner: &'life1 str,
query: &'life2 str,
limit: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<SessionHit>, RecallError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait;
fn scroll<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
owner: &'life1 str,
session_id: &'life2 str,
around: i64,
window: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<RecallMessage>, RecallError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait;
fn recent<'life0, 'life1, 'async_trait>(
&'life0 self,
owner: &'life1 str,
limit: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<SessionMeta>, RecallError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
}Expand description
Cross-session transcript store. All methods are owner-scoped: a given
owner can never see another owner’s sessions.
Required Methods§
Sourcefn ensure_session<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
owner: &'life1 str,
session_id: &'life2 str,
meta: &'life3 SessionMeta,
) -> Pin<Box<dyn Future<Output = Result<(), RecallError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Self: 'async_trait,
fn ensure_session<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
owner: &'life1 str,
session_id: &'life2 str,
meta: &'life3 SessionMeta,
) -> Pin<Box<dyn Future<Output = Result<(), RecallError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Self: 'async_trait,
Create/refresh the session row (idempotent).
Sourcefn append<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
owner: &'life1 str,
session_id: &'life2 str,
msg: &'life3 RecallMessage,
) -> Pin<Box<dyn Future<Output = Result<i64, RecallError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Self: 'async_trait,
fn append<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
owner: &'life1 str,
session_id: &'life2 str,
msg: &'life3 RecallMessage,
) -> Pin<Box<dyn Future<Output = Result<i64, RecallError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Self: 'async_trait,
Append one message; returns the assigned id.
Sourcefn search<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
owner: &'life1 str,
query: &'life2 str,
limit: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<SessionHit>, RecallError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn search<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
owner: &'life1 str,
query: &'life2 str,
limit: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<SessionHit>, RecallError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Discovery: top sessions matching query, with snippet + bookends.
Sourcefn scroll<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
owner: &'life1 str,
session_id: &'life2 str,
around: i64,
window: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<RecallMessage>, RecallError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn scroll<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
owner: &'life1 str,
session_id: &'life2 str,
around: i64,
window: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<RecallMessage>, RecallError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Scroll: messages with id in [around - window, around + window].
Sourcefn recent<'life0, 'life1, 'async_trait>(
&'life0 self,
owner: &'life1 str,
limit: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<SessionMeta>, RecallError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn recent<'life0, 'life1, 'async_trait>(
&'life0 self,
owner: &'life1 str,
limit: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<SessionMeta>, RecallError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Browse: the owner’s most recent sessions, newest first.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".