Applies the last cache-served operation to the wrapped cursor.
(&mut self)
| 177 | impl<C: TrieCursor> CachedTrieCursor<'_, C> { |
| 178 | /// Applies the last cache-served operation to the wrapped cursor. |
| 179 | fn sync(&mut self) -> Result<(), DatabaseError> { |
| 180 | match self.memo.pending.take() { |
| 181 | Some(CursorOp::Seek(key)) => { |
| 182 | self.inner.seek(key)?; |
| 183 | } |
| 184 | Some(CursorOp::SeekExact(key)) => { |
| 185 | self.inner.seek_exact(key)?; |
| 186 | } |
| 187 | Some(CursorOp::Next(key)) => { |
| 188 | self.inner.seek(key)?; |
| 189 | self.inner.next()?; |
| 190 | } |
| 191 | None => {} |
| 192 | } |
| 193 | Ok(()) |
| 194 | } |
| 195 | } |
| 196 | |
| 197 | impl<C: TrieCursor> TrieCursor for CachedTrieCursor<'_, C> { |