MCPcopy Create free account
hub / github.com/clockworklabs/SpacetimeDB / pointers_for_mut

Method pointers_for_mut

crates/table/src/pointer_map.rs:212–217  ·  view source on GitHub ↗

Returns the row pointers associated with the given row `hash`. Take care not to change the reserved bit of any row pointer or this will mess up the internal state of the [`PointerMap`].

(&mut self, hash: RowHash)

Source from the content-addressed store, hash-verified

210 /// Take care not to change the reserved bit of any row pointer
211 /// or this will mess up the internal state of the [`PointerMap`].
212 pub fn pointers_for_mut(&mut self, hash: RowHash) -> &mut [RowPointer] {
213 self.map.get_mut(&hash).map_or(&mut [], |poc| match poc.unpack_mut() {
214 MapSlotMut::Pointer(ro) => slice::from_mut(ro),
215 MapSlotMut::Collider(ci) => &mut self.colliders[ci.idx()],
216 })
217 }
218
219 /// Associates row `hash` with row `ptr`.
220 /// Returns whether `hash` was already associated with `ptr`

Callers

nothing calls this directly

Calls 3

unpack_mutMethod · 0.80
get_mutMethod · 0.45
idxMethod · 0.45

Tested by

no test coverage detected