pub fn range<'txn, R, A>(&self, txn: &'txn RoTxn, range: R) -> Result<RoRange<'txn>>
    where
        R: RangeBounds<A>,
        A: AsRef<[u8]>,
    {
        assert_eq!(self.env_ident, txn.env.env_mut_ptr() as usize);

        let start_bound = match range.start_bound() {
            Bound::Included(bytes) => Bound::Included(bytes.as_ref().to_vec()),
            Bound::Excluded(bytes) => Bound::Excluded(bytes.as_ref().to_vec()),
            Bound::Unbounded => Bound::Unbounded,
        };

        let end_bound = match range.end_bound() {
            Bound::Included(bytes) => Bound::Included(bytes.as_ref().to_vec()),
            Bound::Excluded(bytes) => Bound::Excluded(bytes.as_ref().to_vec()),
            Bound::Unbounded => Bound::Unbounded,
        };

        RoCursor::new(txn, self.dbi).map(|cursor| RoRange::new(cursor, start_bound, end_bound))
    }
/// Return a lexicographically ordered iterator of a range of key-value pairs in this database.
///
/// Comparisons are made by using the bytes representation of the key.
///
/// ```
/// # use std::fs;
/// # use std::path::Path;
/// # use smolheed::EnvOpenOptions;
/// use smolheed::Database;
///
/// # fn main() -> Result<(), Box<dyn std::error::Error>> {
/// # fs::create_dir_all(Path::new("target").join("zerocopy.mdb"))?;
/// # let env = EnvOpenOptions::new()
/// #     .map_size(10 * 1024 * 1024) // 10MB
/// #     .max_dbs(3000)
/// #     .open(Path::new("target").join("zerocopy.mdb"))?;
///
/// let db = env.create_database(Some("iter-i32"))?;
///
/// let mut wtxn = env.write_txn()?;
/// # db.clear(&mut wtxn)?;
/// db.put(&mut wtxn, 42_i32.to_be_bytes(), "i-am-forty-two")?;
/// db.put(&mut wtxn, 27_i32.to_be_bytes(), "i-am-twenty-seven")?;
/// db.put(&mut wtxn, 13_i32.to_be_bytes(), "i-am-thirteen")?;
/// db.put(&mut wtxn, 521_i32.to_be_bytes(), "i-am-five-hundred-and-twenty-one")?;
///
/// let mut iter = db.range(&wtxn, 27_i32.to_be_bytes()..=42_i32.to_be_bytes())?;
/// assert_eq!(iter.next().transpose()?, Some((&27_i32.to_be_bytes()[..], &b"i-am-twenty-seven"[..])));
/// assert_eq!(iter.next().transpose()?, Some((&42_i32.to_be_bytes()[..], &b"i-am-forty-two"[..])));
/// assert_eq!(iter.next().transpose()?, None);
///
/// drop(iter);
/// wtxn.commit()?;
/// # Ok(()) }
/// ```
Return a lexicographically ordered iterator of a range of key-value pairs in this database.
Comparisons are made by using the bytes representation of the key.


Return a lexicographically ordered iterator of a range of key - value pairs in this database . Comparisons are made by using the bytes representation of the key .
pub fn range<'txn, R, A>(&self, txn: &'txn RoTxn, range: R) -> Result<RoRange<'txn>>
    where
        R: RangeBounds<A>,
        A: AsRef<[u8]>,
    {
        assert_eq!(self.env_ident, txn.env.env_mut_ptr() as usize);
        let start_bound = match range.start_bound() {
            Bound::Included(bytes) => Bound::Included(bytes.as_ref().to_vec()),
            Bound::Excluded(bytes) => Bound::Excluded(bytes.as_ref().to_vec()),
            Bound::Unbounded => Bound::Unbounded,
        };
        let end_bound = match range.end_bound() {
            Bound::Included(bytes) => Bound::Included(bytes.as_ref().to_vec()),
            Bound::Excluded(bytes) => Bound::Excluded(bytes.as_ref().to_vec()),
            Bound::Unbounded => Bound::Unbounded,
        };
        RoCursor::new(txn, self.dbi).map(|cursor| RoRange::new(cursor, start_bound, end_bound))
    }
pub fn range < ' txn , R , A > ( & self , txn : & ' txn RoTxn , range : R ) -> Result < RoRange < ' txn > > where R : RangeBounds < A > , A : AsRef < [ u8 ] > , { assert_eq ! ( self env_ident txn env env_mut_ptr ( ) as usize ) ; let start_bound = match range . start_bound ( ) { Bound :: Included ( bytes ) => Bound :: Included ( bytes . as_ref ( ) . to_vec ( ) ) , Bound :: Excluded ( bytes ) => Bound :: Excluded ( bytes . as_ref ( ) . to_vec ( ) ) , Bound :: Unbounded => Bound :: Unbounded , } ; let end_bound = match range . end_bound ( ) { Bound :: Included ( bytes ) => Bound :: Included ( bytes . as_ref ( ) . to_vec ( ) ) , Bound :: Excluded ( bytes ) => Bound :: Excluded ( bytes . as_ref ( ) . to_vec ( ) ) , Bound :: Unbounded => Bound :: Unbounded , } ; RoCursor :: new ( txn , self . dbi ) . map ( | cursor | RoRange :: new ( cursor , start_bound , end_bound ) ) }
Return a lexicographically ordered iterator of a range of key-value pairs in this database.
Return a lexicographically ordered iterator of a range of key - value pairs in this database .
&self
txn
&'txn RoTxn
range
R
&self
txn
&'txn RoTxn
range
R
use std::fs;
None
use std::path::path;
None
use smolheed::envopenoptions;
None
fn main() -> result<(), box<dyn std::error::error>> {
None
fs::create_dir_all(path::new("target").join("zerocopy.mdb"))?;
None
let env = envopenoptions::new()
None
.map_size(10 * 1024 * 1024) // 10mb
None
.max_dbs(3000)
None
.open(path::new("target").join("zerocopy.mdb"))?;
let db = env.create_database(Some("iter-i32"))?.

let mut wtxn = env.write_txn()?.
let db = env . create_database ( Some ( " iter - i32 " )) ? . let mut wtxn = env . write_txn () ? .
db.clear(&mut wtxn)?;
None
ok(()) }
None