Trait ConditionForSegment

Source
pub trait ConditionForSegment<T>: Clone {
    type Type: CheckCondition<T>;

    // Required method
    fn for_segment(&self, reader: &SegmentReader) -> Self::Type;
}
Expand description

A trait that allows defining arbitrary conditions to be checked before considering a matching document for inclusion in the top results.

Required Associated Types§

Source

type Type: CheckCondition<T>

The concrete type of the result from calling for_segment

Required Methods§

Source

fn for_segment(&self, reader: &SegmentReader) -> Self::Type

Creates a Self::Type instance responsible for checking if the matching documents in the given segment reader are to be considered as collection candidates.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<T> ConditionForSegment<T> for (T, DocAddress)
where T: 'static + PartialOrd + Copy,

Source§

type Type = (T, DocAddress)

Source§

fn for_segment(&self, _reader: &SegmentReader) -> Self::Type

Source§

impl<T> ConditionForSegment<T> for bool

Source§

type Type = bool

Source§

fn for_segment(&self, _reader: &SegmentReader) -> Self::Type

Implementors§

Source§

impl<T, C, F> ConditionForSegment<T> for F
where F: Clone + Fn(&SegmentReader) -> C, C: CheckCondition<T>,

Source§

type Type = C