Function sled_search::search[][src]

pub fn search<F>(
    tree: &Tree,
    guide: F
) -> Result<Option<(Vec<u8>, Vec<u8>)>, ()> where
    F: FnMut(&[u8], &[u8]) -> (bool, Ordering)

Search the key space of the tree for an entry using the guide function.

The guide function will return a bool alongside an Ordering where

  • The bool indicates whether or not the search should be updated with the yielded entry.
  • The Ordering indicates whether or not the given entry is greater than or less than the target. If Greater is returned, the search will continue through lesser values. If Less is returned, the search will continue through greater values.

Returns the last entry that caused the guide function to return true.