pub struct SpatialIndex { /* private fields */ }Expand description
A spatial index over elements with evaluated geometry.
Implementations§
Source§impl SpatialIndex
impl SpatialIndex
pub fn build(elements: impl IntoIterator<Item = IndexedElement>) -> Self
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Sourcepub fn query(&self, bounds: &BoundingBox) -> Vec<&IndexedElement>
pub fn query(&self, bounds: &BoundingBox) -> Vec<&IndexedElement>
Everything whose bounds intersect the query box.
Sourcepub fn query_ids(&self, bounds: &BoundingBox) -> Vec<GlobalId>
pub fn query_ids(&self, bounds: &BoundingBox) -> Vec<GlobalId>
Identities of everything intersecting the query box, in stable order.
The R-tree yields results in traversal order, which depends on tree shape. Sorting keeps selection results reproducible across rebuilds — which matters for tests and for anything user-visible.
pub fn iter(&self) -> impl Iterator<Item = &IndexedElement>
Trait Implementations§
Source§impl Clone for SpatialIndex
impl Clone for SpatialIndex
Source§fn clone(&self) -> SpatialIndex
fn clone(&self) -> SpatialIndex
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SpatialIndex
impl Debug for SpatialIndex
Source§impl Default for SpatialIndex
impl Default for SpatialIndex
Source§fn default() -> SpatialIndex
fn default() -> SpatialIndex
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SpatialIndex
impl RefUnwindSafe for SpatialIndex
impl Send for SpatialIndex
impl Sync for SpatialIndex
impl Unpin for SpatialIndex
impl UnsafeUnpin for SpatialIndex
impl UnwindSafe for SpatialIndex
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