Trait odds::slice::SliceFind [] [src]

pub trait SliceFind {
    type Item;
    fn find<U: ?Sized>(&self, elt: &U) -> Option<usize> where Self::Item: PartialEq<U>;
    fn rfind<U: ?Sized>(&self, elt: &U) -> Option<usize> where Self::Item: PartialEq<U>;
}

Element-finding methods for slices

Associated Types

Required Methods

Linear search for the first occurrence elt in the slice.

Return its index if it is found, or None.

Linear search for the last occurrence elt in the slice.

Return its index if it is found, or None.

Implementors