Trait odds::slice::SliceFindSplit
[−]
[src]
pub trait SliceFindSplit { type Item; fn find_split<U: ?Sized>(&self, elt: &U) -> (&Self, &Self)
where
Self::Item: PartialEq<U>; fn rfind_split<U: ?Sized>(&self, elt: &U) -> (&Self, &Self)
where
Self::Item: PartialEq<U>; fn find_split_mut<U: ?Sized>(&mut self, elt: &U) -> (&mut Self, &mut Self)
where
Self::Item: PartialEq<U>; fn rfind_split_mut<U: ?Sized>(&mut self, elt: &U) -> (&mut Self, &mut Self)
where
Self::Item: PartialEq<U>; }
Element-finding methods for slices
Associated Types
type Item
Required Methods
fn find_split<U: ?Sized>(&self, elt: &U) -> (&Self, &Self) where
Self::Item: PartialEq<U>,
Self::Item: PartialEq<U>,
Linear search for the first occurrence elt
in the slice.
Return the part before and the part including and after the element. If the element is not found, the second half is empty.
fn rfind_split<U: ?Sized>(&self, elt: &U) -> (&Self, &Self) where
Self::Item: PartialEq<U>,
Self::Item: PartialEq<U>,
Linear search for the last occurrence elt
in the slice.
Return the part before and the part including and after the element. If the element is not found, the first half is empty.
fn find_split_mut<U: ?Sized>(&mut self, elt: &U) -> (&mut Self, &mut Self) where
Self::Item: PartialEq<U>,
Self::Item: PartialEq<U>,
Linear search for the first occurrence elt
in the slice.
Return the part before and the part including and after the element. If the element is not found, the second half is empty.
fn rfind_split_mut<U: ?Sized>(&mut self, elt: &U) -> (&mut Self, &mut Self) where
Self::Item: PartialEq<U>,
Self::Item: PartialEq<U>,
Linear search for the last occurrence elt
in the slice.
Return the part before and the part including and after the element. If the element is not found, the first half is empty.