pub struct QuadTree<T> { /* private fields */ }
Implementations§
Source§impl<T> QuadTree<T>
impl<T> QuadTree<T>
pub fn new( size: Rect, allow_duplicates: bool, min_children: usize, max_children: usize, max_depth: usize, ) -> QuadTree<T>
pub fn default(size: Rect) -> QuadTree<T>
pub fn insert_with_box(&mut self, t: T, aabb: Rect) -> ItemId
pub fn first(&self) -> Option<ItemId>
pub fn insert(&mut self, t: T) -> ItemIdwhere
T: Spatial,
pub fn query(&self, bounding_box: Rect) -> Vec<(&T, &Rect, ItemId)>where
T: Debug,
pub fn remove(&mut self, item_id: ItemId) -> Option<(T, Rect)>
pub fn iter(&self) -> Iter<'_, ItemId, (T, Rect)>
pub fn inspect<F: FnMut(&Rect, usize, bool)>(&self, f: F)
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn validate(&self) -> boolwhere
T: Debug,
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for QuadTree<T>
impl<T> RefUnwindSafe for QuadTree<T>where
T: RefUnwindSafe,
impl<T> Send for QuadTree<T>where
T: Send,
impl<T> Sync for QuadTree<T>where
T: Sync,
impl<T> Unpin for QuadTree<T>where
T: Unpin,
impl<T> UnwindSafe for QuadTree<T>where
T: UnwindSafe,
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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