News for hackers. Stuff that matters.
Re:Learning rust with entirely too many linked lists (2019) by Animats on Sunday February 13, 2022 @09:21PM (#30327756)
That seems the hard way to do backlinks.

Backlinks as weak links work. It's not symmetrical, but it's sound. Forward links then must be Rc<RefCell<T>> links, while backlinks are Rc<Weak<T>>.

This also generalizes to the thread safe form, Arc<Mutex<T>>.

There are no comments on this comment yet.