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

Method modify_bytes_at

crates/commitlog/src/repo/mem/segment.rs:91–94  ·  view source on GitHub ↗
(&mut self, range: impl SliceIndex<[u8], Output = [u8]>, f: impl FnOnce(&mut [u8]))

Source from the content-addressed store, hash-verified

89 }
90
91 pub fn modify_bytes_at(&mut self, range: impl SliceIndex<[u8], Output = [u8]>, f: impl FnOnce(&mut [u8])) {
92 let mut storage = self.storage.write().unwrap();
93 f(&mut storage.buf[range])
94 }
95
96 pub fn allocated_space(&self) -> u64 {
97 self.storage.read().unwrap().alloc

Callers 1

Calls 2

unwrapMethod · 0.45
writeMethod · 0.45

Tested by 1