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
type Item
Required Methods
fn find<U: ?Sized>(&self, elt: &U) -> Option<usize> where
Self::Item: PartialEq<U>,
Self::Item: PartialEq<U>,
Linear search for the first occurrence elt
in the slice.
Return its index if it is found, or None.
fn rfind<U: ?Sized>(&self, elt: &U) -> Option<usize> where
Self::Item: PartialEq<U>,
Self::Item: PartialEq<U>,
Linear search for the last occurrence elt
in the slice.
Return its index if it is found, or None.