This PR adds a method Arena::invalidate(&mut self, index: Index) -> Option<Index> allowing the user to purposefully invalidate an Index and receive a new index, roughly equivalent to remove followed by insert of the same element but without all the free pointer mess. It also adds methods Index::to_bits/Index::from_bits to make it easier to pass indices outside of Rust; specifically, extra conveniently, thunderdome indices will nicely fit inside a Lua light userdata...
This PR looks great! Can you also add two entries to CHANGELOG.md under the unreleased changes section? That makes it easier to throw this into a release whenever.
This PR adds a method
Arena::invalidate(&mut self, index: Index) -> Option<Index>
allowing the user to purposefully invalidate anIndex
and receive a new index, roughly equivalent toremove
followed byinsert
of the same element but without all the free pointer mess. It also adds methodsIndex::to_bits
/Index::from_bits
to make it easier to pass indices outside of Rust; specifically, extra conveniently, thunderdome indices will nicely fit inside a Lua light userdata...