8 ms·
When implementing Display you only get access to an immutable reference to self, so the only possibly side effects are writes to global variables.
by sidit77 5y ago
When implementing Display you only get access to an immutable reference to self, so the only possibly side effects are writes to global variables.
- bluejekyll 5y agoThat depends on what Self contains. Using the Cell types and some of the other inner mutating types, it is possible to change the interior state of self even behind a shared reference. Additionally, with unsafe it’s also possible. This is in response to “the only possible” statement. Of course, doing so is not advisable.