Get the last value returned by nextval (for currval).
(&self)
| 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> { |
no test coverage detected