No one is using a Vec<T> with indexes for long term storage if you know you will remove and replace items there, it's obvious regardless of programming language that it's a bad idea.
You use a dedicated data structure for this where the keys have a generation and that solves the ABA problem.
Rust has multiple crates that provide such data structures.
No one is using a Vec<T> with indexes for long term storage if you know you will remove and replace items there, it's obvious regardless of programming language that it's a bad idea.
You use a dedicated data structure for this where the keys have a generation and that solves the ABA problem.
Rust has multiple crates that provide such data structures.