pub struct QuadTree<Data: Copy> { /* private fields */ }Implementations§
Source§impl<Data: Copy> QuadTree<Data>
impl<Data: Copy> QuadTree<Data>
Sourcepub fn with_capacity(
x: Range<f64>,
y: Range<f64>,
capacity: u16,
) -> QuadTree<Data>
pub fn with_capacity( x: Range<f64>, y: Range<f64>, capacity: u16, ) -> QuadTree<Data>
§Arguments
x: min_x..max_x defines the area in wich data can be insertedy: min_y..max_y defines the area in wich data can be insertedcapacity: capacity of each TreeNode
Sourcepub fn node(&self) -> &QuadTreeNode<Data>
pub fn node(&self) -> &QuadTreeNode<Data>
§Arguments
returns : &QuadTreeNode the root node of the QuadTree
Trait Implementations§
Source§impl<Data: Copy> SpatialPartitioner<Data> for QuadTree<Data>
impl<Data: Copy> SpatialPartitioner<Data> for QuadTree<Data>
Source§fn new(x: Range<f64>, y: Range<f64>) -> Self
fn new(x: Range<f64>, y: Range<f64>) -> Self
create a QuadTree with a default capacity of 50. More info here QuadTree::new()
Source§fn insert(&mut self, position: (f64, f64), data: Data)
fn insert(&mut self, position: (f64, f64), data: Data)
inserts an obj and checks if position is out of bounce Read more
Source§fn insert_unchecked(&mut self, position: (f64, f64), data: Data)
fn insert_unchecked(&mut self, position: (f64, f64), data: Data)
inserts an obj and DOES NOT check if position is out of bounce Read more
fn clear(&mut self)
Auto Trait Implementations§
impl<Data> Freeze for QuadTree<Data>
impl<Data> RefUnwindSafe for QuadTree<Data>where
Data: RefUnwindSafe,
impl<Data> Send for QuadTree<Data>where
Data: Send,
impl<Data> Sync for QuadTree<Data>where
Data: Sync,
impl<Data> Unpin for QuadTree<Data>where
Data: Unpin,
impl<Data> UnwindSafe for QuadTree<Data>where
Data: 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