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

Method modify_byte_at

crates/commitlog/src/repo/mem/segment.rs:86–89  ·  view source on GitHub ↗
(&mut self, pos: usize, f: impl FnOnce(u8) -> u8)

Source from the content-addressed store, hash-verified

84 }
85
86 pub fn modify_byte_at(&mut self, pos: usize, f: impl FnOnce(u8) -> u8) {
87 let mut storage = self.storage.write().unwrap();
88 storage.buf[pos] = f(storage.buf[pos])
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();

Callers

nothing calls this directly

Calls 2

unwrapMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected