pub struct AsgFeedbackStore<'a> {
pub repo: &'a Repository,
pub fts: Option<&'a SearchFtsDb>,
}Fields§
§repo: &'a Repository§fts: Option<&'a SearchFtsDb>Borrowed FTS connection from the owning Engine. When Some,
enables the SQLite write-through cache: list_all reads from SQLite
if populated, record writes to SQLite after the git commit.
Implementations§
Source§impl<'a> AsgFeedbackStore<'a>
impl<'a> AsgFeedbackStore<'a>
Sourcepub fn new(repo: &'a Repository) -> Self
pub fn new(repo: &'a Repository) -> Self
Construct without SQLite caching (tests, internal calls).
Sourcepub fn from_engine(engine: &'a Engine) -> Self
pub fn from_engine(engine: &'a Engine) -> Self
Convenience: borrow the FTS connection already open in engine.
Trait Implementations§
Source§impl<'a> FeedbackStore for AsgFeedbackStore<'a>
impl<'a> FeedbackStore for AsgFeedbackStore<'a>
Source§fn purge(&self, ref_name: &str, entry_id: &str) -> Result<Option<FeedbackEntry>>
fn purge(&self, ref_name: &str, entry_id: &str) -> Result<Option<FeedbackEntry>>
Hard-delete a verdict from BOTH stores. See the trait method.
Source§fn record(
&self,
ref_name: &str,
entry: &FeedbackEntry,
agent_id: &str,
) -> Result<()>
fn record( &self, ref_name: &str, entry: &FeedbackEntry, agent_id: &str, ) -> Result<()>
Record a verdict for a (query, symbol) pair.
Source§fn list_for_symbol(
&self,
ref_name: &str,
symbol_id: &str,
) -> Result<Vec<FeedbackEntry>>
fn list_for_symbol( &self, ref_name: &str, symbol_id: &str, ) -> Result<Vec<FeedbackEntry>>
All feedback entries recorded for a specific symbol.
Source§fn list_all(&self, ref_name: &str) -> Result<Vec<FeedbackEntry>>
fn list_all(&self, ref_name: &str) -> Result<Vec<FeedbackEntry>>
Every feedback entry in the store.
Source§fn withdraw(
&self,
ref_name: &str,
entry_id: &str,
by: &str,
reason: Option<&str>,
) -> Result<Option<FeedbackEntry>>
fn withdraw( &self, ref_name: &str, entry_id: &str, by: &str, reason: Option<&str>, ) -> Result<Option<FeedbackEntry>>
Retract a verdict so it stops influencing ranking, keeping the record. Read more
Source§fn flat_verdicts(
&self,
ref_name: &str,
) -> Result<Vec<(String, String, FeedbackVerdict, DateTime<Utc>)>>
fn flat_verdicts( &self, ref_name: &str, ) -> Result<Vec<(String, String, FeedbackVerdict, DateTime<Utc>)>>
Flatten all feedback into (symbol_id, query, verdict, created_at)
tuples for use in
apply_feedback_adjustments. Plan J t-016 added
created_at so the boost arithmetic can decay Useful verdicts by
age — a 6-month-old opinion about a codebase shouldn’t carry the
same weight as yesterday’s.Source§fn flat_file_scope_verdicts(
&self,
ref_name: &str,
) -> Result<Vec<(String, FeedbackVerdict, String, DateTime<Utc>)>>
fn flat_file_scope_verdicts( &self, ref_name: &str, ) -> Result<Vec<(String, FeedbackVerdict, String, DateTime<Utc>)>>
Flatten file-scoped feedback into (file_glob, verdict, query, created_at)
tuples for use in
apply_file_scope_feedback. Plan J t-016: same
reason — decay file-scope Useful verdicts by age.Auto Trait Implementations§
impl<'a> !RefUnwindSafe for AsgFeedbackStore<'a>
impl<'a> !Send for AsgFeedbackStore<'a>
impl<'a> !Sync for AsgFeedbackStore<'a>
impl<'a> !UnwindSafe for AsgFeedbackStore<'a>
impl<'a> Freeze for AsgFeedbackStore<'a>
impl<'a> Unpin for AsgFeedbackStore<'a>
impl<'a> UnsafeUnpin for AsgFeedbackStore<'a>
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