pub struct QuadTree { /* private fields */ }Expand description
Quadtree for 2D spatial indexing
Implementations§
Source§impl QuadTree
impl QuadTree
pub fn new(bounds: Rectangle, max_points: usize, max_depth: usize) -> Self
pub fn insert(&mut self, point: Point, data: usize)
pub fn query(&self, query_bounds: &Rectangle) -> Vec<(Point, usize)>
pub fn nearest_neighbor( &self, query: &Point, max_distance: Option<f64>, ) -> Option<(Point, usize, f64)>
Auto Trait Implementations§
impl Freeze for QuadTree
impl RefUnwindSafe for QuadTree
impl Send for QuadTree
impl Sync for QuadTree
impl Unpin for QuadTree
impl UnwindSafe for QuadTree
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> 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