pub trait SliceCompareExt<T> {
// Required methods
fn self_comparer(&self) -> Comparer<'_, T> ⓘ;
fn self_comparer_mut(&mut self) -> ComparerMut<'_, T>;
// Provided methods
fn compare_self<F: FnMut(&T, &T)>(&self, f: F) { ... }
fn compare_self_enumerated<F: FnMut((usize, &T), (usize, &T))>(&self, f: F) { ... }
fn compare_self_mut<F: FnMut(&mut T, &mut T)>(&mut self, f: F) { ... }
fn compare_self_enumerated_mut<F: FnMut((usize, &mut T), (usize, &mut T))>(
&mut self,
f: F,
) { ... }
}
Expand description
Extra methods for slices to compare with self
Required Methods§
Sourcefn self_comparer(&self) -> Comparer<'_, T> ⓘ
fn self_comparer(&self) -> Comparer<'_, T> ⓘ
Returns a Comparer
from a reference to a slice
Sourcefn self_comparer_mut(&mut self) -> ComparerMut<'_, T>
fn self_comparer_mut(&mut self) -> ComparerMut<'_, T>
Returns a Comparer
from a reference to a mutable slice
Provided Methods§
Sourcefn compare_self<F: FnMut(&T, &T)>(&self, f: F)
fn compare_self<F: FnMut(&T, &T)>(&self, f: F)
Convenience function for itereating through the Comparer
and applying a function to each pair
Sourcefn compare_self_enumerated<F: FnMut((usize, &T), (usize, &T))>(&self, f: F)
fn compare_self_enumerated<F: FnMut((usize, &T), (usize, &T))>(&self, f: F)
Same as compare_self()
but also parses the indices of the elements to the function
Sourcefn compare_self_mut<F: FnMut(&mut T, &mut T)>(&mut self, f: F)
fn compare_self_mut<F: FnMut(&mut T, &mut T)>(&mut self, f: F)
Convenience function for itereating through the ComparerMut
and applying a function to each pair
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.