RTree

Struct RTree 

Source
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>

Source

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> AsRef<[u8]> for RTree<N>

Source§

fn as_ref(&self) -> &[u8]

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<N: Clone + IndexableNum> Clone for RTree<N>

Source§

fn clone(&self) -> RTree<N>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<N: Debug + IndexableNum> Debug for RTree<N>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<N: PartialEq + IndexableNum> PartialEq for RTree<N>

Source§

fn eq(&self, other: &RTree<N>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<N: IndexableNum> RTreeIndex<N> for RTree<N>

Source§

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<'_>

A slice representing the indices within the boxes slice, including internal nodes.
Source§

fn metadata(&self) -> &RTreeMetadata<N>

Access the metadata describing this RTree
Source§

fn num_items(&self) -> u32

The total number of items contained in this RTree.
Source§

fn num_nodes(&self) -> usize

The total number of nodes in this RTree, including both leaf and intermediate nodes.
Source§

fn node_size(&self) -> u16

The maximum number of elements in each node.
Source§

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

The number of levels (height) of the tree.
Source§

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>

Search an RTree given the provided bounding box. Read more
Source§

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>

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>

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

Returns an iterator over the indexes of objects in this and another tree that intersect. Read more
Source§

fn root(&self) -> Node<'_, N, Self>

Access the root node of the RTree for manual traversal.
Source§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.