pub struct SpatialHasher<T: Hash + Eq + Copy + Clone> {
pub map: Vec<Vec<HashSet<T, FastHash>>>,
/* private fields */
}
Fields§
§map: Vec<Vec<HashSet<T, FastHash>>>
Implementations§
Source§impl<T: Hash + Eq + Copy + Clone> SpatialHasher<T>
impl<T: Hash + Eq + Copy + Clone> SpatialHasher<T>
pub fn new(w: usize, h: usize, tile_size: Vect) -> Self
pub fn get_coord(&self, pos: Vect) -> (usize, usize)
pub fn insert(&mut self, pos: Vect, id: T) -> (usize, usize)
pub fn remove(&mut self, pos: (usize, usize), id: T) -> bool
pub fn slow_remove(&mut self, id: T) -> bool
pub fn update( &mut self, old: (usize, usize), new: Vect, id: T, ) -> (usize, usize)
pub fn query(&self, rect: &Rect, collector: &mut Vec<T>)
pub fn query_point(&self, pos: Vect, collector: &mut Vec<T>)
pub fn get_shape_count(&self) -> usize
Auto Trait Implementations§
impl<T> Freeze for SpatialHasher<T>
impl<T> RefUnwindSafe for SpatialHasher<T>where
T: RefUnwindSafe,
impl<T> Send for SpatialHasher<T>where
T: Send,
impl<T> Sync for SpatialHasher<T>where
T: Sync,
impl<T> Unpin for SpatialHasher<T>where
T: Unpin,
impl<T> UnwindSafe for SpatialHasher<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> 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