I want the variable p to keep ownership of the refcells and the map variable to be a way to index them differently. But I get this error on lifetimes that I don't understand nor know how to solve.
Okay, fair enough, you can't have references from one field to another without irrevocably borrowing it for the rest of its existence, making it impossible to use the type after the call, except for ways compatible with that eternal borrow.
True. The simple example here can be made to compile but once you try doing anything else with this code, you're likely to get deadlocked by the borrow checker
Indeed I tried this fn foo(self: &'a mut Self) but couldn't use my object anymore afterwards in its methods... Is there a rust-ic way or pattern to do this without getting annoyed by the borrow-checker ?