pub struct QuerySubjectUseCase<P, V>{ /* private fields */ }Expand description
Use-case: return the resolved belief for every predicate under a subject.
Generic over persistence and vector ports (mirrors QueryMemoryUseCase).
Implementations§
Source§impl<P, V> QuerySubjectUseCase<P, V>
impl<P, V> QuerySubjectUseCase<P, V>
pub fn new( persistence: Arc<P>, vector: Option<Arc<V>>, config: EngineConfig, ) -> Self
Sourcepub fn execute_with_time(
&self,
req: QuerySubjectRequest,
now: DateTime<Utc>,
) -> Result<QuerySubjectResponse, MemError>
pub fn execute_with_time( &self, req: QuerySubjectRequest, now: DateTime<Utc>, ) -> Result<QuerySubjectResponse, MemError>
Execute with an explicit now (DETERMINISM — no clock reads here).
Algorithm:
- list_predicates_for_subject → distinct predicates visible at as_of_tx_time.
- For each predicate, run the existing QueryMemoryUseCase fold (same valid_at + as_of_tx_time), collecting a SubjectFactEntry.
- Sort entries by predicate (stable, deterministic output).
Sourcepub fn execute(
&self,
req: QuerySubjectRequest,
) -> Result<QuerySubjectResponse, MemError>
pub fn execute( &self, req: QuerySubjectRequest, ) -> Result<QuerySubjectResponse, MemError>
Convenience wrapper that stamps now internally.
Auto Trait Implementations§
impl<P, V> Freeze for QuerySubjectUseCase<P, V>
impl<P, V> RefUnwindSafe for QuerySubjectUseCase<P, V>where
P: RefUnwindSafe,
V: RefUnwindSafe,
impl<P, V> Send for QuerySubjectUseCase<P, V>
impl<P, V> Sync for QuerySubjectUseCase<P, V>
impl<P, V> Unpin for QuerySubjectUseCase<P, V>
impl<P, V> UnsafeUnpin for QuerySubjectUseCase<P, V>
impl<P, V> UnwindSafe for QuerySubjectUseCase<P, V>where
P: RefUnwindSafe,
V: RefUnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more