LPGhatguy / thunderdome

Arena type inspired by generational-arena
Apache License 2.0
197 stars 15 forks source link

Add insert_at and insert_at_slot API #30

Closed sdleffler closed 2 years ago

sdleffler commented 2 years ago

This PR adds insert_at(&mut self, Index, T) -> Option<T> and insert_at_slot(&mut self, u32, T) -> (Index, Option<T>) methods; these are useful for manipulating the arena by-slot and doing deserialization or other circumstances in which we need to "resurrect" a previous or future index.