pub trait EpisodicMemory: Send + Sync {
// Required methods
fn record(
&self,
event_type: &str,
payload: Value,
) -> impl Future<Output = Result<String>> + Send;
fn query(
&self,
query: EpisodicQuery,
) -> impl Future<Output = Result<Vec<EpisodicEvent>>> + Send;
fn clear(&self) -> impl Future<Output = Result<()>> + Send;
}Expand description
Trait for structured, timestamped event log backends.
Required Methods§
Sourcefn record(
&self,
event_type: &str,
payload: Value,
) -> impl Future<Output = Result<String>> + Send
fn record( &self, event_type: &str, payload: Value, ) -> impl Future<Output = Result<String>> + Send
Records an event and returns its assigned id. Implementations stamp
timestamp_ms with the current time.
Sourcefn query(
&self,
query: EpisodicQuery,
) -> impl Future<Output = Result<Vec<EpisodicEvent>>> + Send
fn query( &self, query: EpisodicQuery, ) -> impl Future<Output = Result<Vec<EpisodicEvent>>> + Send
Returns events matching query, most recent first.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".