pub struct MortonSpatialHash { /* private fields */ }Expand description
Spatial hash system using Morton encoding + Roaring bitmaps
Implementations§
Source§impl MortonSpatialHash
impl MortonSpatialHash
Sourcepub fn add_neuron(
&self,
cortical_area: String,
x: u32,
y: u32,
z: u32,
neuron_id: u64,
) -> bool
pub fn add_neuron( &self, cortical_area: String, x: u32, y: u32, z: u32, neuron_id: u64, ) -> bool
Add a neuron to the spatial hash
Sourcepub fn get_neuron_at_coordinate(
&self,
cortical_area: &str,
x: u32,
y: u32,
z: u32,
) -> Option<u64>
pub fn get_neuron_at_coordinate( &self, cortical_area: &str, x: u32, y: u32, z: u32, ) -> Option<u64>
Get first neuron at coordinate (or None)
Sourcepub fn get_neurons_at_coordinate(
&self,
cortical_area: &str,
x: u32,
y: u32,
z: u32,
) -> Vec<u64>
pub fn get_neurons_at_coordinate( &self, cortical_area: &str, x: u32, y: u32, z: u32, ) -> Vec<u64>
Get all neurons at coordinate
Sourcepub fn get_neurons_in_region(
&self,
cortical_area: &str,
x1: u32,
y1: u32,
z1: u32,
x2: u32,
y2: u32,
z2: u32,
) -> Vec<u64>
pub fn get_neurons_in_region( &self, cortical_area: &str, x1: u32, y1: u32, z1: u32, x2: u32, y2: u32, z2: u32, ) -> Vec<u64>
Get all neurons in a 3D region
Sourcepub fn get_neuron_position(
&self,
neuron_id: u64,
) -> Option<(String, u32, u32, u32)>
pub fn get_neuron_position( &self, neuron_id: u64, ) -> Option<(String, u32, u32, u32)>
Get neuron’s position
Sourcepub fn remove_neuron(&self, neuron_id: u64) -> bool
pub fn remove_neuron(&self, neuron_id: u64) -> bool
Remove a neuron from the spatial hash
Sourcepub fn get_stats(&self) -> SpatialHashStats
pub fn get_stats(&self) -> SpatialHashStats
Get statistics
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MortonSpatialHash
impl RefUnwindSafe for MortonSpatialHash
impl Send for MortonSpatialHash
impl Sync for MortonSpatialHash
impl Unpin for MortonSpatialHash
impl UnwindSafe for MortonSpatialHash
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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