Trait try_partialord::TryBinarySearch[][src]

pub trait TryBinarySearch<T> {
    fn try_binary_search_by<F>(
        &self,
        compare: F
    ) -> OrderResult<Result<usize, usize>>
    where
        F: FnMut(&T) -> Option<Ordering>
; fn try_binary_search(&self, x: &T) -> OrderResult<Result<usize, usize>>
    where
        T: PartialOrd<T>
, { ... }
fn try_binary_search_by_key<K, F>(
        &self,
        b: &K,
        f: F
    ) -> OrderResult<Result<usize, usize>>
    where
        F: FnMut(&T) -> Option<K>,
        K: PartialOrd<K>
, { ... } }

Binary Search methods for PartialOrd.

Caution! This might not return error even if there is invalid order value (like f32::NAN), because including these value means that it is not sorted correctly and we cannot ensure the return value of binary_search for unsorted slice.

Required methods

fn try_binary_search_by<F>(
    &self,
    compare: F
) -> OrderResult<Result<usize, usize>> where
    F: FnMut(&T) -> Option<Ordering>, 
[src]

Loading content...

Provided methods

fn try_binary_search_by_key<K, F>(
    &self,
    b: &K,
    f: F
) -> OrderResult<Result<usize, usize>> where
    F: FnMut(&T) -> Option<K>,
    K: PartialOrd<K>, 
[src]

Loading content...

Implementations on Foreign Types

impl<T> TryBinarySearch<T> for [T][src]

Loading content...

Implementors

Loading content...