Enum core::slice::BinarySearchResultExperimental [-]  [+] [src]

pub enum BinarySearchResult {
    Found(uint),
    NotFound(uint),
}

The result of calling binary_search.

Found means the search succeeded, and the contained value is the index of the matching element. NotFound means the search succeeded, and the contained value is an index where a matching value could be inserted while maintaining sort order.

Variants

Found

The index of the found value.

NotFound

The index where the value should have been found.

Methods

impl BinarySearchResult

fn found(&self) -> Option<uint>

Converts a Found to Some, NotFound to None. Similar to Result::ok.

fn not_found(&self) -> Option<uint>

Convert a Found to None, NotFound to Some. Similar to Result::err.

Trait Implementations

Derived Implementations

impl Show for BinarySearchResult

fn fmt(&self, __arg_0: &mut Formatter) -> Result

impl PartialEq for BinarySearchResult

fn eq(&self, __arg_0: &BinarySearchResult) -> bool

fn ne(&self, __arg_0: &BinarySearchResult) -> bool