pub struct ExperiencePool { /* private fields */ }Expand description
SQLite-backed experience pool.
Records task-to-file associations and supports keyword-based file retrieval.
Implementations§
Source§impl ExperiencePool
impl ExperiencePool
Sourcepub fn open(path: &Path) -> Result<Self, ExperienceError>
pub fn open(path: &Path) -> Result<Self, ExperienceError>
Open or create the experience database at the given path.
Sourcepub fn record(&self, entry: &ExperienceEntry) -> Result<(), ExperienceError>
pub fn record(&self, entry: &ExperienceEntry) -> Result<(), ExperienceError>
Record an edit event, inserting one row per file in ExperienceEntry::files_modified.
Sourcepub fn query_files(
&self,
description: &str,
) -> Result<Vec<(String, u32)>, ExperienceError>
pub fn query_files( &self, description: &str, ) -> Result<Vec<(String, u32)>, ExperienceError>
Query relevant files for a task description.
Uses keyword matching against stored task descriptions.
Returns (file_path, count) pairs sorted by frequency descending.
§Example
let files = pool.query_files("fix authentication bug").unwrap();
for (path, count) in files {
println!("{path}: {count}");
}Auto Trait Implementations§
impl !Freeze for ExperiencePool
impl RefUnwindSafe for ExperiencePool
impl Send for ExperiencePool
impl Sync for ExperiencePool
impl Unpin for ExperiencePool
impl UnsafeUnpin for ExperiencePool
impl UnwindSafe for ExperiencePool
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