Skip to main content

AsgFeedbackStore

Struct AsgFeedbackStore 

Source
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>

Source

pub fn new(repo: &'a Repository) -> Self

Construct without SQLite caching (tests, internal calls).

Source

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>

Source§

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<()>

Record a verdict for a (query, symbol) pair.
Source§

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>>

Every feedback entry in the store.
Source§

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>)>>

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>)>>

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> 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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.