Skip to main content

FusionExecutor

Trait FusionExecutor 

Source
pub trait FusionExecutor:
    Send
    + Sync
    + 'static {
    // Required methods
    fn rank_score_kind(&self) -> RankScoreKind;
    fn fuse<'life0, 'life1, 'async_trait>(
        &'life0 self,
        streams: Vec<CandidateStream>,
        params: &'life1 Value,
        limit: usize,
    ) -> Pin<Box<dyn Future<Output = RuntimeResult<Vec<RankedHit>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Runtime-registered custom fusion strategy (ADR-012).

Packs implement this to plug a strategy into FusionStrategy::Custom { name, .. } via KhiveRuntime::register_fusion_strategy — the seam a learned-sparse (SPLADE) retrieval leg plugs into. Async so an executor can perform I/O (e.g. a decay/posterior lookup) while fusing, and fallible so it can reject malformed params instead of degrading silently.

Required Methods§

Source

fn rank_score_kind(&self) -> RankScoreKind

Declare the strategy represented by the executor’s ordering score.

Source

fn fuse<'life0, 'life1, 'async_trait>( &'life0 self, streams: Vec<CandidateStream>, params: &'life1 Value, limit: usize, ) -> Pin<Box<dyn Future<Output = RuntimeResult<Vec<RankedHit>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Combine streams into a single ranked list, honoring limit as a hint (the dispatch boundary re-sorts and truncates the result with the crate’s canonical comparator regardless, so an executor need not sort or truncate defensively itself).

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§