MCPcopy Create free account
hub / github.com/aiscriptdev/aiscript / Unlock

Interface Unlock

aiscript-arena/src/barrier.rs:126–139  ·  view source on GitHub ↗

Types that support additional operations (typically, mutation) when behind a write barrier.

Source from the content-addressed store, hash-verified

124
125/// Types that support additional operations (typically, mutation) when behind a write barrier.
126pub 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///

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected