pub struct Grid<Data: Copy> { /* private fields */ }Implementations§
Source§impl<Data: Copy> Grid<Data>
impl<Data: Copy> Grid<Data>
Sourcepub fn with_cell_count(
x: Range<f64>,
y: Range<f64>,
cell_count: (usize, usize),
) -> Grid<Data>
pub fn with_cell_count( x: Range<f64>, y: Range<f64>, cell_count: (usize, usize), ) -> Grid<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 insertedcell_count: (count_x, count_y) defines how many cell should be present
Sourcepub fn cell(&self, indexes: (usize, usize)) -> &Vec<((f64, f64), Data)>
pub fn cell(&self, indexes: (usize, usize)) -> &Vec<((f64, f64), Data)>
§Arguments
indexes: (x,y) cord of the cell
returns: &Vec<((f64, f64), Data), Global> the data stored in the cell
Sourcepub fn cell_count(&self) -> (usize, usize)
pub fn cell_count(&self) -> (usize, usize)
§Arguments
returns: (usize, usize) the defined cell_count
Trait Implementations§
Source§impl<Data: Copy> SpatialPartitioner<Data> for Grid<Data>
impl<Data: Copy> SpatialPartitioner<Data> for Grid<Data>
Source§fn new(x: Range<f64>, y: Range<f64>) -> Self
fn new(x: Range<f64>, y: Range<f64>) -> Self
create a Grid with a default size of (100,100). More info here Grid::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 Grid<Data>
impl<Data> RefUnwindSafe for Grid<Data>where
Data: RefUnwindSafe,
impl<Data> Send for Grid<Data>where
Data: Send,
impl<Data> Sync for Grid<Data>where
Data: Sync,
impl<Data> Unpin for Grid<Data>where
Data: Unpin,
impl<Data> UnwindSafe for Grid<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