I'm writing some simulation code with a vector of entities. Each entity must be updated with read access to the other entities. There are different types of entities, and each type can have one or more states.
Is there a way in Rust to get both a mutable reference to a single element, and an immutable reference to the vector of other elements? Right now I'm using a combination of a mutable reference to the vector and an index into it.