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

Method set_epoch

crates/commitlog/src/commitlog.rs:110–119  ·  view source on GitHub ↗

Update the current epoch. Does nothing if the given `epoch` is equal to the current epoch. # Errors If `epoch` is smaller than the current epoch, an error of kind [`io::ErrorKind::InvalidInput`] is returned.

(&mut self, epoch: u64)

Source from the content-addressed store, hash-verified

108 /// If `epoch` is smaller than the current epoch, an error of kind
109 /// [`io::ErrorKind::InvalidInput`] is returned.
110 pub fn set_epoch(&mut self, epoch: u64) -> io::Result<()> {
111 if epoch < self.head.epoch() {
112 return Err(io::Error::new(
113 io::ErrorKind::InvalidInput,
114 "new epoch is smaller than current epoch",
115 ));
116 }
117 self.head.set_epoch(epoch);
118 Ok(())
119 }
120
121 /// Force the currently active segment to be flushed to storage.
122 ///

Callers 2

set_new_epochFunction · 0.45

Calls 4

ErrFunction · 0.50
newFunction · 0.50
OkFunction · 0.50
epochMethod · 0.45

Tested by 2

set_new_epochFunction · 0.36