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

Method reset_to

crates/commitlog/src/commitlog.rs:233–243  ·  view source on GitHub ↗
(mut self, offset: u64)

Source from the content-addressed store, hash-verified

231 }
232
233 pub fn reset_to(mut self, offset: u64) -> io::Result<Self> {
234 info!("reset to {offset}");
235
236 self.panicked = true;
237 self.tail.reserve(1);
238 self.tail.push(self.head.min_tx_offset);
239 reset_to_internal(&self.repo, &self.tail, offset)?;
240 // Prevent finalizer from running by not updating self.panicked.
241
242 Self::open(self.repo.clone(), self.opts)
243 }
244
245 /// Start a new segment, preserving the current head's `Commit`.
246 ///

Callers 2

reset_to_offsetFunction · 0.45

Calls 5

reset_to_internalFunction · 0.85
reserveMethod · 0.80
openFunction · 0.50
pushMethod · 0.45
cloneMethod · 0.45

Tested by 2

reset_to_offsetFunction · 0.36