pub enum Node<T> {
Leaf(Vec<T>),
Branch(Vec<(Bounds, Node<T>)>),
}Expand description
One node of the tree.
A Node::Leaf stores the indexed values directly; a
Node::Branch stores (child_bounds, child_node) pairs. Mirrors
the leaf / internal split of Boost’s rtree node variant.
Variants§
Leaf(Vec<T>)
Values at the bottom of the tree.
Branch(Vec<(Bounds, Node<T>)>)
Child subtrees, each paired with its bounding box.
Implementations§
Source§impl<T: Indexable> Node<T>
impl<T: Indexable> Node<T>
Sourcepub fn bounds(&self) -> Option<Bounds>
pub fn bounds(&self) -> Option<Bounds>
The bounding box covering everything in this node, or None for
an empty node.
Sourcepub fn entry_count(&self) -> usize
pub fn entry_count(&self) -> usize
Number of immediate entries (values in a leaf, children in a branch).
Sourcepub fn value_count(&self) -> usize
pub fn value_count(&self) -> usize
Total number of leaf values in this subtree.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Node<T>
impl<T> RefUnwindSafe for Node<T>where
T: RefUnwindSafe,
impl<T> Send for Node<T>where
T: Send,
impl<T> Sync for Node<T>where
T: Sync,
impl<T> Unpin for Node<T>where
T: Unpin,
impl<T> UnsafeUnpin for Node<T>
impl<T> UnwindSafe for Node<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