Trait SearchEntry

Source
pub trait SearchEntry {
    type Id: Eq;

    // Required method
    fn id(&self) -> &Self::Id;

    // Provided methods
    fn score(&self) -> Score { ... }
    fn to_entry(&self) -> EntryInfo<Self::Id>
       where Self::Id: Clone { ... }
}
Expand description

A search result entry with a unique document identifier and a similarity score. Types need to implement this type in order to be admitted as a search result.

Required Associated Types§

Source

type Id: Eq

The unique document identifier type.

Required Methods§

Source

fn id(&self) -> &Self::Id

Retrieves this entry’s document ID.

Provided Methods§

Source

fn score(&self) -> Score

Retrieves this entry’s similarity score.

Source

fn to_entry(&self) -> EntryInfo<Self::Id>
where Self::Id: Clone,

Constructs a minimalist entry info data structure.

Implementations on Foreign Types§

Source§

impl<'a, T> SearchEntry for &'a T
where T: SearchEntry + ?Sized,

Source§

type Id = <T as SearchEntry>::Id

Source§

fn id(&self) -> &Self::Id

Source§

fn score(&self) -> Score

Source§

fn to_entry(&self) -> EntryInfo<Self::Id>
where Self::Id: Clone,

Implementors§

Source§

impl SearchEntry for TrecEntryOwned

Source§

impl<'a> SearchEntry for TrecEntry<'a>

Source§

type Id = &'a str

Source§

impl<I> SearchEntry for EntryInfo<I>
where I: Eq,

Source§

type Id = I

Source§

impl<I> SearchEntry for RankedEntryInfo<I>
where I: Eq,

Source§

type Id = I

Source§

impl<T> SearchEntry for Ranked<T>
where T: SearchEntry,

Source§

type Id = <T as SearchEntry>::Id