pub struct Grid<T, A, M: Mapper<T, A>, const S_CELLS: usize = DEFAULT_S_CELLS, const S_MAPS: usize = DEFAULT_S_MAPS> { /* private fields */ }Implementations§
Source§impl<T, A, M: Mapper<T, A>, const S_CELLS: usize, const S_MAPS: usize> Grid<T, A, M, S_CELLS, S_MAPS>
impl<T, A, M: Mapper<T, A>, const S_CELLS: usize, const S_MAPS: usize> Grid<T, A, M, S_CELLS, S_MAPS>
pub fn with_capacity(cell: usize, map: usize) -> Self
Source§impl<T, A, M: Mapper<T, A>, const S_CELLS: usize, const S_MAPS: usize> Grid<T, A, M, S_CELLS, S_MAPS>
impl<T, A, M: Mapper<T, A>, const S_CELLS: usize, const S_MAPS: usize> Grid<T, A, M, S_CELLS, S_MAPS>
Sourcepub unsafe fn inner_cells(
&mut self,
) -> &mut Table<Entry<T, S_CELLS>, BuildHasherDefault<MortonHasher>>
pub unsafe fn inner_cells( &mut self, ) -> &mut Table<Entry<T, S_CELLS>, BuildHasherDefault<MortonHasher>>
§SAFETY
You MUST NOT modify the table structure if you are not sure what you are doing.
Sourcepub unsafe fn inner_maps(
&mut self,
) -> &mut Table<Entry<M::Entry, S_MAPS>, BuildHasherDefault<DummyHasher>>
pub unsafe fn inner_maps( &mut self, ) -> &mut Table<Entry<M::Entry, S_MAPS>, BuildHasherDefault<DummyHasher>>
§SAFETY
You MUST NOT modify the table structure if you are not sure what you are doing.
Source§impl<T, A, M: Mapper<T, A>, const S_CELLS: usize, const S_MAPS: usize> Grid<T, A, M, S_CELLS, S_MAPS>
impl<T, A, M: Mapper<T, A>, const S_CELLS: usize, const S_MAPS: usize> Grid<T, A, M, S_CELLS, S_MAPS>
pub fn insert(&mut self, key: T, entity: M::Input)
pub fn remove(&mut self, key: &T) -> Option<()>
Sourcepub fn query(&self, range: impl IntoCellIter<A>) -> impl Iterator<Item = T>
pub fn query(&self, range: impl IntoCellIter<A>) -> impl Iterator<Item = T>
Query the grid for entities within a range.
This method does not check for duplicates caused by hash-collisions, or Mapper’s presentation (e.g. multi-cell item of [RangeMapper]).
pub fn clear(&mut self)
Trait Implementations§
Auto Trait Implementations§
impl<T, A, M, const S_CELLS: usize, const S_MAPS: usize> Freeze for Grid<T, A, M, S_CELLS, S_MAPS>
impl<T, A, M, const S_CELLS: usize, const S_MAPS: usize> RefUnwindSafe for Grid<T, A, M, S_CELLS, S_MAPS>
impl<T, A, M, const S_CELLS: usize, const S_MAPS: usize> Send for Grid<T, A, M, S_CELLS, S_MAPS>
impl<T, A, M, const S_CELLS: usize, const S_MAPS: usize> Sync for Grid<T, A, M, S_CELLS, S_MAPS>
impl<T, A, M, const S_CELLS: usize, const S_MAPS: usize> Unpin for Grid<T, A, M, S_CELLS, S_MAPS>
impl<T, A, M, const S_CELLS: usize, const S_MAPS: usize> UnsafeUnpin for Grid<T, A, M, S_CELLS, S_MAPS>
impl<T, A, M, const S_CELLS: usize, const S_MAPS: usize> UnwindSafe for Grid<T, A, M, S_CELLS, S_MAPS>
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