BoxRankingRule

This commit is contained in:
Louis Dureuil
2023-03-28 12:39:42 +02:00
parent 8d7d8cdc2f
commit b4a52a622e
4 changed files with 13 additions and 9 deletions

View File

@ -15,6 +15,8 @@ pub struct PlaceholderQuery;
impl RankingRuleQueryTrait for PlaceholderQuery {}
impl RankingRuleQueryTrait for QueryGraph {}
pub type BoxRankingRule<'ctx, Query> = Box<dyn RankingRule<'ctx, Query> + 'ctx>;
/// A trait that must be implemented by all ranking rules.
///
/// It is generic over `'ctx`, the lifetime of the search context
@ -70,7 +72,7 @@ pub struct RankingRuleOutput<Q> {
pub fn bucket_sort<'ctx, Q: RankingRuleQueryTrait>(
ctx: &mut SearchContext<'ctx>,
mut ranking_rules: Vec<Box<dyn RankingRule<'ctx, Q>>>,
mut ranking_rules: Vec<BoxRankingRule<'ctx, Q>>,
query: &Q,
universe: &RoaringBitmap,
from: usize,