(&self)
| 167 | } |
| 168 | |
| 169 | pub fn open_cursor(&self) -> Result<u64, BufIoError> { |
| 170 | let cursor_id = self.next_cursor_id.fetch_add(1, Ordering::SeqCst); |
| 171 | let mut cursors = self.cursors.write().map_err(|_| BufIoError::Locking)?; |
| 172 | cursors.insert(cursor_id, Cursor::new()); |
| 173 | Ok(cursor_id) |
| 174 | } |
| 175 | |
| 176 | // @DOUBT: The caller will need to remember to call close_cursor, |
| 177 | // other wise the cursors will keep accumulating. One way to |