Trait RangeQuery

Source
pub trait RangeQuery<'a>: Knn<'a> {
    type RangeIter: IntoIterator<Item = (Neighbor<<Self::Metric as Metric<Self::Point>>::Unit, Self::Ix>, &'a Self::Point, &'a Self::Value)>;

    // Required method
    fn range_query(
        &self,
        query: &Self::Point,
        range: <Self::Metric as Metric<Self::Point>>::Unit,
    ) -> Self::RangeIter;
}
Expand description

Implement this trait on data structures (or wrappers) which perform range queries. The data structure should maintain a key-value mapping between neighbour points and data values.

The lifetime on the trait will be removed once GATs are stabilized.

Required Associated Types§

Source

type RangeIter: IntoIterator<Item = (Neighbor<<Self::Metric as Metric<Self::Point>>::Unit, Self::Ix>, &'a Self::Point, &'a Self::Value)>

Required Methods§

Source

fn range_query( &self, query: &Self::Point, range: <Self::Metric as Metric<Self::Point>>::Unit, ) -> Self::RangeIter

Get all the points in the data structure that lie within a specified range of the query point. The points may or may not be sorted by distance.

Implementors§