pub struct MruRanker { /* private fields */ }Expand description
rank:mru. Combines the matcher’s MatchScore with a per-
candidate bonus (frecency / recency / MRU-style) supplied by
the caller. Bonus is added to the score; the result is
re-sorted descending with alphabetical tie-break.
Slice 3c.unify.mru-promotion: promoted from
lattice-picker’s inline combined = score + bonus
arithmetic to a first-class CandidateRanker impl. The
bonus lookup is a caller-supplied closure so different
surfaces can choose their identity scheme:
- Picker decodes the index encoded in
CandidateData::Extension(the existing parallel-bonus-vec scheme). - Cmdline-completion (future) can look up by candidate text
in a
HashMap<String, f64>derived from the host’s MRU index at filter time. - Plugins supply their own lookup against whatever identity scheme they prefer.
MruRanker subsumes the ScoreRanker behavior (it sorts by
score when every bonus is 0.0), so the typical pipeline
composition is rankers: vec![Arc::new(MruRanker::new(...))]
— not stacking [ScoreRanker, MruRanker] which would just be
a wasted first sort.
Implementations§
Trait Implementations§
Source§impl CandidateRanker for MruRanker
impl CandidateRanker for MruRanker
fn rank(&self, scored: &mut Vec<ScoredCandidate>)
Auto Trait Implementations§
impl !RefUnwindSafe for MruRanker
impl !UnwindSafe for MruRanker
impl Freeze for MruRanker
impl Send for MruRanker
impl Sync for MruRanker
impl Unpin for MruRanker
impl UnsafeUnpin for MruRanker
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