fn _insert(&mut self, region: Region, data: ND, index: Index) {
        // Parent node should always contain the input region
        assert_eq!(
            self.nodes[index].get_region().contains_region(&region),
            Ok(true)
        );

        // add a new leaf as a child of this node
        let leaf_node = Node::new_leaf(region, data, Some(index));
        let leaf_index = self.nodes.insert(leaf_node);

        // This call is safe as `leaf_index` has their parent attribute set to `Some(index)`, i.e.
        // the index of the current node, and the child node is contained in this tree.
        self.get_node_mut(index).add_child_unsafe(leaf_index);

        // If this node node has too many children, split it.
        if self.get_node(index).child_count() >= self.max_children {
            self.split_node(index);
        }
    }
/// Inserts a node with data `data` into the tree at the given index.  This function is unsafe
/// as using it incorrectly can use to inconsistent data.  A key assumption here is that
/// `region` must be contained in the minimum bounding region of the node corresponding to `index`.
Inserts a node with data `data` into the tree at the given index.  This function is unsafe
as using it incorrectly can use to inconsistent data.  A key assumption here is that
`region` must be contained in the minimum bounding region of the node corresponding to `index`.
Inserts a node with data ` data ` into the tree at the given index . This function is unsafe as using it incorrectly can use to inconsistent data . A key assumption here is that ` region ` must be contained in the minimum bounding region of the node corresponding to ` index ` .
fn _insert(&mut self, region: Region, data: ND, index: Index) {
        // Parent node should always contain the input region
        assert_eq!(
            self.nodes[index].get_region().contains_region(&region),
            Ok(true)
        );
        // add a new leaf as a child of this node
        let leaf_node = Node::new_leaf(region, data, Some(index));
        let leaf_index = self.nodes.insert(leaf_node);
        // This call is safe as `leaf_index` has their parent attribute set to `Some(index)`, i.e.
        // the index of the current node, and the child node is contained in this tree.
        self.get_node_mut(index).add_child_unsafe(leaf_index);
        // If this node node has too many children, split it.
        if self.get_node(index).child_count() >= self.max_children {
            self.split_node(index);
        }
    }
fn _insert ( & mut self , region : Region , data : ND , index : Index ) { // Parent node should always contain the input region assert_eq ! ( self nodes [ index ] get_region ( ) contains_region ( region ) Ok ( true ) ) ; // add a new leaf as a child of this node let leaf_node = Node :: new_leaf ( region , data , Some ( index ) ) ; let leaf_index = self . nodes . insert ( leaf_node ) ; // This call is safe as `leaf_index` has their parent attribute set to `Some(index)`, i.e. // the index of the current node, and the child node is contained in this tree. self . get_node_mut ( index ) . add_child_unsafe ( leaf_index ) ; // If this node node has too many children, split it. if self . get_node ( index ) . child_count ( ) >= self . max_children { self . split_node ( index ) ; } }
Inserts a node with data `data` into the tree at the given index.
Inserts a node with data ` data ` into the tree at the given index .
&mut self
region
Region
data
ND
index
Index
&mut self
region
Region
data
ND
index
Index