Performs a binary search on the values with a key extraction function. Assumes that the values are sorted by the key extracted by the function. If the value is found then `Ok(K)` is returned, containing the entity key of the matching value. If there are multiple matches, then any one of the matches could be returned. If the value is not found then Err(K) is returned, containing the entity key
(&'a self, b: &B, f: F)
| 213 | /// If the value is not found then Err(K) is returned, containing the entity key |
| 214 | /// where a matching element could be inserted while maintaining sorted order. |
| 215 | pub fn binary_search_values_by_key<'a, B, F>(&'a self, b: &B, f: F) -> Result<K, K> |
| 216 | where |
| 217 | F: FnMut(&'a V) -> B, |
| 218 | B: Ord, |
| 219 | { |
| 220 | self.elems |
| 221 | .binary_search_by_key(b, f) |
| 222 | .map(|i| K::new(i)) |
| 223 | .map_err(|i| K::new(i)) |
| 224 | } |
| 225 | |
| 226 | /// Analog of `get_raw` except that a raw pointer is returned rather than a |
| 227 | /// mutable reference. |
nothing calls this directly
no test coverage detected