MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / currval

Method currval

nodedb/src/control/sequence/types.rs:171–178  ·  view source on GitHub ↗

Get the last value returned by nextval (for currval).

(&self)

Source from the content-addressed store, hash-verified

169
170 /// Get the last value returned by nextval (for currval).
171 pub fn currval(&self) -> Result<i64, SequenceError> {
172 if !self.called.load(Ordering::Relaxed) {
173 return Err(SequenceError::NotYetCalled {
174 name: self.def.name.clone(),
175 });
176 }
177 Ok(self.counter.load(Ordering::Relaxed))
178 }
179
180 /// Set the counter to a specific value (for setval).
181 pub fn setval(&self, value: i64) -> Result<i64, SequenceError> {

Callers 1

allocate_chunkMethod · 0.45

Calls 2

loadMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected