pub trait SliceBisectExt<T> {
// Required methods
fn find_bisect(&self, f: impl FnMut(&T) -> bool) -> Option<&T>;
fn rfind_bisect(&self, f: impl FnMut(&T) -> bool) -> Option<&T>;
fn position_bisect(&self, f: impl FnMut(&T) -> bool) -> usize;
fn rposition_bisect(&self, f: impl FnMut(&T) -> bool) -> usize;
}
Expand description
binary search for slice
Required Methods§
Sourcefn find_bisect(&self, f: impl FnMut(&T) -> bool) -> Option<&T>
fn find_bisect(&self, f: impl FnMut(&T) -> bool) -> Option<&T>
Returns the first element that satisfies a predicate.
Sourcefn rfind_bisect(&self, f: impl FnMut(&T) -> bool) -> Option<&T>
fn rfind_bisect(&self, f: impl FnMut(&T) -> bool) -> Option<&T>
Returns the last element that satisfies a predicate.
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.