Skip to content

Latest commit

 

History

History
21 lines (15 loc) · 653 Bytes

element_iterations.md

File metadata and controls

21 lines (15 loc) · 653 Bytes

Element Iterations

Another way to see elements in the tree is through iterations. Here is an example:

use rstar::RTree;

fn main() {
    let tree: RTree<(i32, i32)> = RTree::new();
    for element in &tree {
        println!("{:?}", element);
    }
}

We can also use iter and iter_mut to obtain an (mutable) iteration of the elements in the tree.

➡️ Next: Inserting One Element At A Time

📘 Back: Table of contents