pub struct RTree<N: IndexableNum> { /* private fields */ }Expand description
An owned RTree buffer.
Usually this will be created from scratch via RTreeBuilder.
Implementations§
Source§impl<N: IndexableNum> RTree<N>
impl<N: IndexableNum> RTree<N>
Sourcepub fn into_inner(self) -> Vec<u8> ⓘ
pub fn into_inner(self) -> Vec<u8> ⓘ
Access the underlying buffer of this RTree.
This buffer can then be persisted and passed to RTreeRef::try_new.
Trait Implementations§
Source§impl<N: IndexableNum> RTreeIndex<N> for RTree<N>
impl<N: IndexableNum> RTreeIndex<N> for RTree<N>
Source§fn boxes(&self) -> &[N]
fn boxes(&self) -> &[N]
A slice representing all the bounding boxes of all elements contained within this tree,
including the bounding boxes of each internal node.
Source§fn indices(&self) -> Indices<'_>
fn indices(&self) -> Indices<'_>
A slice representing the indices within the
boxes slice, including internal nodes.Source§fn metadata(&self) -> &RTreeMetadata<N>
fn metadata(&self) -> &RTreeMetadata<N>
Access the metadata describing this RTree
Source§fn num_nodes(&self) -> usize
fn num_nodes(&self) -> usize
The total number of nodes in this RTree, including both leaf and intermediate nodes.
Source§fn level_bounds(&self) -> &[usize]
fn level_bounds(&self) -> &[usize]
The offsets into RTreeIndex::boxes where each level’s boxes starts and ends. The tree is
laid out bottom-up, and there’s an implicit initial 0. So the boxes of the lowest level of
the tree are located from
boxes[0..self.level_bounds()[0]].Source§fn num_levels(&self) -> usize
fn num_levels(&self) -> usize
The number of levels (height) of the tree.
Source§fn boxes_at_level(&self, level: usize) -> Result<&[N], GeoIndexError>
fn boxes_at_level(&self, level: usize) -> Result<&[N], GeoIndexError>
The tree is laid out from bottom to top. Level 0 is the base of the tree. Each integer
higher is one level higher of the tree.
Source§fn search(&self, min_x: N, min_y: N, max_x: N, max_y: N) -> Vec<u32>
fn search(&self, min_x: N, min_y: N, max_x: N, max_y: N) -> Vec<u32>
Search an RTree given the provided bounding box. Read more
Source§fn search_rect(&self, rect: &impl RectTrait<T = N>) -> Vec<u32>
fn search_rect(&self, rect: &impl RectTrait<T = N>) -> Vec<u32>
Search an RTree given the provided bounding box. Read more
Source§fn neighbors(
&self,
x: N,
y: N,
max_results: Option<usize>,
max_distance: Option<N>,
) -> Vec<u32>
fn neighbors( &self, x: N, y: N, max_results: Option<usize>, max_distance: Option<N>, ) -> Vec<u32>
Search items in order of distance from the given point. Read more
Source§fn neighbors_coord(
&self,
coord: &impl CoordTrait<T = N>,
max_results: Option<usize>,
max_distance: Option<N>,
) -> Vec<u32>
fn neighbors_coord( &self, coord: &impl CoordTrait<T = N>, max_results: Option<usize>, max_distance: Option<N>, ) -> Vec<u32>
Search items in order of distance from the given coordinate.
Source§fn intersection_candidates_with_other_tree<'a>(
&'a self,
other: &'a impl RTreeIndex<N>,
) -> impl Iterator<Item = (u32, u32)> + 'a
fn intersection_candidates_with_other_tree<'a>( &'a self, other: &'a impl RTreeIndex<N>, ) -> impl Iterator<Item = (u32, u32)> + 'a
Returns an iterator over the indexes of objects in this and another tree that intersect. Read more
impl<N: IndexableNum> StructuralPartialEq for RTree<N>
Auto Trait Implementations§
impl<N> Freeze for RTree<N>
impl<N> RefUnwindSafe for RTree<N>where
N: RefUnwindSafe,
impl<N> Send for RTree<N>
impl<N> Sync for RTree<N>
impl<N> Unpin for RTree<N>where
N: Unpin,
impl<N> UnwindSafe for RTree<N>where
N: 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