Get a mutable node by id. Returns `None` for nil ids, stale generations, out-of-bounds slots, or empty slots.
(&mut self, id: NodeID)
| 199 | |
| 200 | /// Create an empty arena. |
| 201 | /// |
| 202 | /// Slot 0 is reserved as the nil sentinel, so the first inserted node uses |
| 203 | /// index 1. |
| 204 | pub fn new() -> Self { |
| 205 | // Reserve index 0 as invalid/nil sentinel so first real node ID is 1. |
| 206 | let mut nodes = Vec::with_capacity(2); |
| 207 | let mut generations = Vec::with_capacity(2); |
| 208 | nodes.push(None); |