pub struct Store { /* private fields */ }Implementations§
Source§impl Store
impl Store
pub fn preferences(&self, access: &Access, id: &str) -> Result<Preferences>
Sourcepub fn set_preferences(
&self,
access: &Access,
id: &str,
expected: i64,
pinned: bool,
suppressed: bool,
) -> Result<Preferences>
pub fn set_preferences( &self, access: &Access, id: &str, expected: i64, pinned: bool, suppressed: bool, ) -> Result<Preferences>
A pin affects context packing; it never bypasses validity, scope or review. Suppression affects future recall only, not context already sent.
pub fn lens_snapshot( &self, access: &Access, trace: Option<&str>, after: Option<&str>, limit: usize, snapshot: &Snapshot, ) -> Result<LensSnapshot>
Sourcepub fn memory_as_of(
&self,
access: &Access,
id: &str,
known_at: i64,
valid_at: i64,
) -> Result<HistoricalMemory>
pub fn memory_as_of( &self, access: &Access, id: &str, known_at: i64, valid_at: i64, ) -> Result<HistoricalMemory>
Two clocks: status known by known_at, fact valid at valid_at.
Later supersession is not leaked into historical status. Forgotten content
is unavailable at every cutoff. Migrated stores expose only known history.
Sourcepub fn context_packet(
&self,
access: &Access,
query: &Recall,
counter: &dyn TokenCounter,
budget: &ContextBudget,
) -> Result<(RecallReport, ContextPacket)>
pub fn context_packet( &self, access: &Access, query: &Recall, counter: &dyn TokenCounter, budget: &ContextBudget, ) -> Result<(RecallReport, ContextPacket)>
The read-only half of prepare_context: filtered recall plus explicit
pins, compiled into a packet — with no receipt recorded. Host surfaces
that assemble the same bytes but have no session scope to attest
(previews, reports, frozen prompts) must use this so the traced and
untraced paths can never diverge on pin membership or packet shape.
Sourcepub fn prepare_context(
&self,
access: &Access,
context_scope: &Scope,
trace: &str,
request_key: &str,
query: &Recall,
counter: &dyn TokenCounter,
budget: &ContextBudget,
) -> Result<PreparedContext>
pub fn prepare_context( &self, access: &Access, context_scope: &Scope, trace: &str, request_key: &str, query: &Recall, counter: &dyn TokenCounter, budget: &ContextBudget, ) -> Result<PreparedContext>
Called by the host at a meaningful retrieval boundary, not every token. Idempotent within a trace + host request key. Text is returned, not logged.
Sourcepub fn preflight_context(
&self,
access: &Access,
id: &str,
packet_hash: &str,
snapshot: &Snapshot,
) -> Result<()>
pub fn preflight_context( &self, access: &Access, id: &str, packet_hash: &str, snapshot: &Snapshot, ) -> Result<()>
Before-action gate. The host must serialize this check and append/dispatch against mutations within its single owner. The acknowledgement is separate.
Sourcepub fn acknowledge_append(
&self,
access: &Access,
id: &str,
packet_hash: &str,
history_sequence: i64,
snapshot: &Snapshot,
) -> Result<()>
pub fn acknowledge_append( &self, access: &Access, id: &str, packet_hash: &str, history_sequence: i64, snapshot: &Snapshot, ) -> Result<()>
Invoke ONLY after the engine has durably appended these exact packet bytes. An error means missing acknowledgement, not permission to append twice.
Sourcepub fn acknowledge_dispatch(
&self,
access: &Access,
id: &str,
packet_hash: &str,
transport_key: &str,
snapshot: &Snapshot,
) -> Result<()>
pub fn acknowledge_dispatch( &self, access: &Access, id: &str, packet_hash: &str, transport_key: &str, snapshot: &Snapshot, ) -> Result<()>
Invoke after a transport dispatch. Does not claim provider acceptance, successful execution, useful recall, or causal attribution of an outcome.
pub fn context_receipts( &self, access: &Access, trace: Option<&str>, snapshot: &Snapshot, ) -> Result<Vec<ContextReceipt>>
Source§impl Store
impl Store
Source§impl Store
impl Store
pub fn open(path: impl AsRef<Path>) -> Result<Self>
pub fn open_for_listing(path: &Path) -> Result<Option<Self>>
pub fn in_memory() -> Result<Self>
pub fn in_memory_with_clock( clock: impl Fn() -> i64 + Send + Sync + 'static, ) -> Result<Self>
pub fn timestamp(&self) -> i64
Sourcepub fn freshness(
&self,
access: &Access,
memory: &Memory,
snapshot: &Snapshot,
) -> Result<Freshness>
pub fn freshness( &self, access: &Access, memory: &Memory, snapshot: &Snapshot, ) -> Result<Freshness>
Validate the complete provenance chain, not just this record’s own hashes.