pub struct TopRetriever { /* private fields */ }Expand description
Cap the result list to n hits after the upstream operator resolves.
Sort by descending score before truncating so callers always get the top-N by score (regardless of how the upstream returned them).
Implementations§
Source§impl TopRetriever
impl TopRetriever
Trait Implementations§
Source§impl Retriever for TopRetriever
impl Retriever for TopRetriever
Source§fn retrieve<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 QueryContext,
) -> Pin<Box<dyn Future<Output = Result<Vec<RawHit>, LunarisError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
TopRetriever: 'async_trait,
fn retrieve<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 QueryContext,
) -> Pin<Box<dyn Future<Output = Result<Vec<RawHit>, LunarisError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
TopRetriever: 'async_trait,
Run the operator against
ctx and return the unranked-or-ranked
raw hits this operator produces. The downstream stage (combinator
or fuse_rrf) decides what to do with them.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Cast this operator to
&dyn Any so the RRF routing dispatcher can
recover the concrete operator type. Concrete operators override with
fn as_any(&self) -> &dyn Any { self }. The default returns a sentinel
&() so unknown operators downcast as None (and the dispatcher falls
back to client-side RRF instead of misrouting).Auto Trait Implementations§
impl !RefUnwindSafe for TopRetriever
impl !UnwindSafe for TopRetriever
impl Freeze for TopRetriever
impl Send for TopRetriever
impl Sync for TopRetriever
impl Unpin for TopRetriever
impl UnsafeUnpin for TopRetriever
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more