Types that support additional operations (typically, mutation) when behind a write barrier.
| 124 | |
| 125 | /// Types that support additional operations (typically, mutation) when behind a write barrier. |
| 126 | pub trait Unlock { |
| 127 | /// This will typically be a cell-like type providing some sort of interior mutability. |
| 128 | type Unlocked: ?Sized; |
| 129 | |
| 130 | /// Provides unsafe access to the unlocked type, *without* triggering a write barrier. |
| 131 | /// |
| 132 | /// # Safety |
| 133 | /// |
| 134 | /// In order to maintain the invariants of the garbage collector, no new `Gc` pointers |
| 135 | /// may be adopted by as a result of the interior mutability afforded by the unlocked value, |
| 136 | /// unless the write barrier for the containing `Gc` pointer is invoked manually before |
| 137 | /// collection is triggered. |
| 138 | unsafe fn unlock_unchecked(&self) -> &Self::Unlocked; |
| 139 | } |
| 140 | |
| 141 | /// Macro for named field projection behind [`Write`] references. |
| 142 | /// |
nothing calls this directly
no outgoing calls
no test coverage detected