adding iter_from to multi store

main
Niko PLP 8 months ago
parent 8f5ad79c0c
commit c746abb443
  1. 1
      .gitignore
  2. 17
      src/store/multi.rs

1
.gitignore vendored

@ -2,3 +2,4 @@
target/
**/*.rs.bk
Cargo.lock
.vscode/

@ -105,6 +105,23 @@ where
Ok(res)
}
/// Provides a cursor to all of the values starting at key or after
pub fn iter_from<'r, R, I, C, K>(&self, reader: &'r R, k: K) -> Result<Iter<'r, I>, StoreError>
where
R: Readable<'r, Database = D, RoCursor = C>,
I: BackendIter<'r>,
C: BackendRoCursor<'r, Iter = I>,
K: AsRef<[u8]> + 'r,
{
let cursor = reader.open_ro_cursor(&self.db)?;
let iter = cursor.into_iter_from(k);
Ok(Iter {
iter,
phantom: PhantomData,
})
}
/// Provides the first value that matches this key
pub fn get_first<'r, R, K>(&self, reader: &'r R, k: K) -> Result<Option<Value<'r>>, StoreError>
where

Loading…
Cancel
Save