Function rustc_ap_rustc_data_structures::binary_search_util::binary_search_slice[][src]

pub fn binary_search_slice<E, K, 'd>(
    data: &'d [E],
    key_fn: impl Fn(&E) -> K,
    key: &K
) -> &'d [E]

Notable traits for &'_ mut [u8]

impl<'_> Write for &'_ mut [u8]impl<'_> Read for &'_ [u8]
where
    K: Ord

Uses a sorted slice data: &[E] as a kind of "multi-map". The key_fn extracts a key of type K from the data, and this function finds the range of elements that match the key. data must have been sorted as if by a call to sort_by_key for this to work.