-
We also use GcCell (Rc> but with cycle tracing, provided by a crate we forked) on everything that is independent of global state. Those things can take &mut self, and for that we have to be very careful about where we take our borrows. We actually create wrapper types around all our interior-mutable state so that the called function can decide when to borrow itself, which would be a lot less cumbersome if we had arbitrary self types stabilized. As it stands we have to do stuff like:
-
SaaSHub
SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives
-
-
This was inspired by the approach in rust-z80emu (my CPU is written as a seperate module, hence the MemoryBus trait to provide a clean seperation).