pub trait MemoryPersistence {
// Required methods
fn insert(&mut self, item: MemoryItem) -> Result<bool, MemoryStoreError>;
fn insert_evidence(
&self,
link: EvidenceLink,
) -> Result<(), MemoryStoreError>;
fn retrieve(
&self,
query: &str,
limit: usize,
) -> Result<Vec<RetrievalResult>, MemoryStoreError>;
fn get(&self, id: &str) -> Result<Option<MemoryItem>, MemoryStoreError>;
fn count(&self) -> Result<usize, MemoryStoreError>;
fn graph_upsert_node(
&self,
node: &GraphNode,
) -> Result<(), MemoryStoreError>;
fn graph_upsert_edge(
&self,
edge: &GraphEdge,
) -> Result<(), MemoryStoreError>;
fn graph_recall(
&self,
seed_ids: &[&str],
max_hops: usize,
min_edge_weight: f64,
fanout: usize,
) -> Result<Vec<AssociationResult>, MemoryStoreError>;
fn retention_candidates(
&self,
policy: &RetentionPolicy,
) -> Result<Vec<RetentionCandidate>, MemoryStoreError>;
}Expand description
Domain operations for persisted memories and their provenance.
A metadata-only storage capability descriptor is not an operational implementation of this trait. The existing SQLite-backed store is the only binding here; no default or caller is changed by this declaration.
Required Methods§
Sourcefn insert(&mut self, item: MemoryItem) -> Result<bool, MemoryStoreError>
fn insert(&mut self, item: MemoryItem) -> Result<bool, MemoryStoreError>
Preserve add-only semantics: false means an exact duplicate was ignored.
Sourcefn insert_evidence(&self, link: EvidenceLink) -> Result<(), MemoryStoreError>
fn insert_evidence(&self, link: EvidenceLink) -> Result<(), MemoryStoreError>
Attach source provenance to an existing memory item.
Sourcefn retrieve(
&self,
query: &str,
limit: usize,
) -> Result<Vec<RetrievalResult>, MemoryStoreError>
fn retrieve( &self, query: &str, limit: usize, ) -> Result<Vec<RetrievalResult>, MemoryStoreError>
Return existing bounded, scored lexical retrieval results.
Sourcefn get(&self, id: &str) -> Result<Option<MemoryItem>, MemoryStoreError>
fn get(&self, id: &str) -> Result<Option<MemoryItem>, MemoryStoreError>
Look up one memory by its stable domain identifier.
Sourcefn count(&self) -> Result<usize, MemoryStoreError>
fn count(&self) -> Result<usize, MemoryStoreError>
Count authoritative memory records.
Sourcefn graph_upsert_node(&self, node: &GraphNode) -> Result<(), MemoryStoreError>
fn graph_upsert_node(&self, node: &GraphNode) -> Result<(), MemoryStoreError>
Upsert a domain graph node without treating it as a vector index.
Sourcefn graph_upsert_edge(&self, edge: &GraphEdge) -> Result<(), MemoryStoreError>
fn graph_upsert_edge(&self, edge: &GraphEdge) -> Result<(), MemoryStoreError>
Upsert a domain graph edge preserving its evidence semantics.
Sourcefn graph_recall(
&self,
seed_ids: &[&str],
max_hops: usize,
min_edge_weight: f64,
fanout: usize,
) -> Result<Vec<AssociationResult>, MemoryStoreError>
fn graph_recall( &self, seed_ids: &[&str], max_hops: usize, min_edge_weight: f64, fanout: usize, ) -> Result<Vec<AssociationResult>, MemoryStoreError>
Recall associated records within existing graph traversal bounds.
Sourcefn retention_candidates(
&self,
policy: &RetentionPolicy,
) -> Result<Vec<RetentionCandidate>, MemoryStoreError>
fn retention_candidates( &self, policy: &RetentionPolicy, ) -> Result<Vec<RetentionCandidate>, MemoryStoreError>
Select records eligible under the existing retention policy.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".