pub trait SliceFindSplit {
type Item;
// Required methods
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>;
}Expand description
Element-finding methods for slices
Required Associated Types§
Required Methods§
Sourcefn find_split<U: ?Sized>(&self, elt: &U) -> (&Self, &Self)
fn find_split<U: ?Sized>(&self, elt: &U) -> (&Self, &Self)
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.
Sourcefn rfind_split<U: ?Sized>(&self, elt: &U) -> (&Self, &Self)
fn rfind_split<U: ?Sized>(&self, elt: &U) -> (&Self, &Self)
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.
Sourcefn find_split_mut<U: ?Sized>(&mut self, elt: &U) -> (&mut Self, &mut Self)
fn find_split_mut<U: ?Sized>(&mut self, elt: &U) -> (&mut Self, &mut Self)
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.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.