pub struct SessionExperienceStore { /* private fields */ }Expand description
In-memory, session-scoped ExperienceStore — pure (no fs). A Vec in
insertion order; relevance is computed on read, so the store stays a simple
deterministic log (no clock/uuid) for stable tests.
Trait Implementations§
Source§impl Default for SessionExperienceStore
impl Default for SessionExperienceStore
Source§fn default() -> SessionExperienceStore
fn default() -> SessionExperienceStore
Returns the “default value” for a type. Read more
Source§impl ExperienceStore for SessionExperienceStore
impl ExperienceStore for SessionExperienceStore
Source§fn record(&self, task: &str, outcome: &str, lesson: &str) -> bool
fn record(&self, task: &str, outcome: &str, lesson: &str) -> bool
Store an experience IFF it clears the write-gate; returns whether it did.
Source§fn relevant(&self, query: &str, top_k: usize) -> Vec<Experience>
fn relevant(&self, query: &str, top_k: usize) -> Vec<Experience>
The
top_k experiences most relevant to query by keyword overlap, ties
broken by recency (most-recent first). Empty when nothing overlaps.Source§fn total_chars(&self) -> u64
fn total_chars(&self) -> u64
Total chars across all stored fields (for
/context stats).Auto Trait Implementations§
impl !Freeze for SessionExperienceStore
impl RefUnwindSafe for SessionExperienceStore
impl Send for SessionExperienceStore
impl Sync for SessionExperienceStore
impl Unpin for SessionExperienceStore
impl UnsafeUnpin for SessionExperienceStore
impl UnwindSafe for SessionExperienceStore
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more