pub fn scan_prefix<P>(&self, prefix: P) -> Iter<LEAF_FANOUT>
    where
        P: AsRef<[u8]>,
    {
        let prefix_ref = prefix.as_ref();
        let mut upper = prefix_ref.to_vec();

        while let Some(last) = upper.pop() {
            if last < u8::MAX {
                upper.push(last + 1);
                return self.range(prefix_ref..&upper);
            }
        }

        self.range(prefix..)
    }
Create an iterator over tuples of keys and values
where all keys start with the given prefix.

# Examples

```
# fn main() -> Result<(), Box<dyn std::error::Error>> {
# let config = sled::Config::tmp().unwrap();
# let db: sled::Db<1024> = config.open()?;
use sled::InlineArray;
db.insert(&[0, 0, 0], vec![0, 0, 0])?;
db.insert(&[0, 0, 1], vec![0, 0, 1])?;
db.insert(&[0, 0, 2], vec![0, 0, 2])?;
db.insert(&[0, 0, 3], vec![0, 0, 3])?;
db.insert(&[0, 1, 0], vec![0, 1, 0])?;
db.insert(&[0, 1, 1], vec![0, 1, 1])?;

let prefix: &[u8] = &[0, 0];
let mut r = db.scan_prefix(prefix);
assert_eq!(
r.next().unwrap().unwrap(),
(InlineArray::from(&[0, 0, 0]), InlineArray::from(&[0, 0, 0]))
);
assert_eq!(
r.next().unwrap().unwrap(),
(InlineArray::from(&[0, 0, 1]), InlineArray::from(&[0, 0, 1]))
);
assert_eq!(
r.next().unwrap().unwrap(),
(InlineArray::from(&[0, 0, 2]), InlineArray::from(&[0, 0, 2]))
);
assert_eq!(
r.next().unwrap().unwrap(),
(InlineArray::from(&[0, 0, 3]), InlineArray::from(&[0, 0, 3]))
);
assert!(r.next().is_none());
# Ok(()) }
```
src/tree.rs