Skip to main content

InMemoryFacts

Struct InMemoryFacts 

Source
pub struct InMemoryFacts { /* private fields */ }

Implementations§

Source§

impl InMemoryFacts

Source

pub fn seed(&self, fact: Fact)

Insert a fact bypassing save (no async, no Result) — used to seed fixtures before the use case runs.

Source

pub fn get_clone(&self, id: &FactId) -> Option<Fact>

Read-only snapshot of a stored fact by id.

Source

pub fn script_dedup_hits(&self, hits: Vec<SearchHit>)

Program the response returned by search_for_dedup.

Source

pub fn script_search_hits(&self, hits: Vec<SearchHit>)

Program the response returned by search_similar. Used by EnrichRequest::execute unit tests to push vector-search survivors into the rerank stage.

Source

pub fn is_empty(&self) -> bool

Source

pub fn contains(&self, id: &FactId) -> bool

Trait Implementations§

Source§

impl Clone for InMemoryFacts

Source§

fn clone(&self) -> InMemoryFacts

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Default for InMemoryFacts

Source§

fn default() -> InMemoryFacts

Returns the “default value” for a type. Read more
Source§

impl FactRepository for InMemoryFacts

Source§

async fn save(&self, fact: &Fact) -> Result<(), RepoError>

Insert or replace a fact (idempotent by FactId).
Source§

async fn get( &self, id: &FactId, _memory_key: &MemoryKey, ) -> Result<Option<Fact>, RepoError>

Look up a fact by id within a memory namespace. Read more
Source§

async fn list_accepted( &self, _memory_key: &MemoryKey, ) -> Result<Vec<Fact>, RepoError>

All currently-accepted facts in a namespace (§3 retrieval pool).
Source§

async fn list_pending( &self, _memory_key: &MemoryKey, ) -> Result<Vec<Fact>, RepoError>

All currently-pending facts in a namespace (§5 session-end input).
Source§

async fn list_memory_keys_for_session( &self, session_id: &SessionId, ) -> Result<Vec<MemoryKey>, RepoError>

Distinct memory_keys whose fact set references session_id in source_sessions. Read more
Source§

async fn list_memory_keys(&self) -> Result<Vec<MemoryKey>, RepoError>

Distinct memory_key values across every namespace in the store. Read more
Source§

async fn search_similar( &self, _embedding: Vec<f32>, _memory_key: &MemoryKey, _limit: usize, ) -> Result<Vec<SearchHit>, RepoError>

K-nearest-neighbour vector search against accepted facts. Read more
Source§

async fn search_for_dedup( &self, _embedding: Vec<f32>, _memory_key: &MemoryKey, _limit: usize, ) -> Result<Vec<SearchHit>, RepoError>

Semantic-dedup search across pending AND accepted facts (no tombstones). Used by the extraction pipeline’s safety-net Layer 2 (persist_facts step 2): a rephrased re-observation hashes to a different FactId, so the exact match misses — but the embedding is still near-identical and a cross-session confirmation can promote the existing fact past the accept threshold. Read more
Source§

async fn update_heat_batch( &self, _ids: &[FactId], _memory_key: &MemoryKey, _heat_base: Heat, _last_access: Timestamp, ) -> Result<(), RepoError>

Bulk-rewrite heat fields for a set of facts (§7 retrieval rewarm). Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more