Skip to main content

IsKNearestSearchable

Trait IsKNearestSearchable 

Source
pub trait IsKNearestSearchable<Search, Find> {
    // Required methods
    fn nearest(&self, search: &Search) -> Result<Find>;
    fn knearest(&self, search: &Search, n: usize, result: &mut Vec<Find>);
}
Expand description

IsKNearestSearchable trait used for search structures which can be queried for nearest neighbours. You should only implement this, if your solution is rather efficient

Required Methods§

Source

fn nearest(&self, search: &Search) -> Result<Find>

Should return the nearest neighbour to search, if there is any

Source

fn knearest(&self, search: &Search, n: usize, result: &mut Vec<Find>)

Should return the k nearest neighbours to search

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl<PSearch, PFind> IsKNearestSearchable<PSearch, PFind> for KdTree<PFind>
where PSearch: Is3D, PFind: Is3D + Clone,