Trait fera_graph::ext::GraphsSliceExt
source · pub trait GraphsSliceExt<T> {
fn is_sorted_by_prop<P, K>(&self, prop: P) -> bool
where
P: PropGet<K>,
for<'a> &'a T: IntoOwned<K>,
P::Output: Ord;
fn sort_by_prop<P, K>(&mut self, prop: P)
where
P: PropGet<K>,
for<'a> &'a T: IntoOwned<K>,
P::Output: Ord;
fn sort_unstable_by_prop<P, K>(&mut self, prop: P)
where
P: PropGet<K>,
for<'a> &'a T: IntoOwned<K>,
P::Output: Ord;
fn binary_search_by_prop<P, K>(
&self,
prop_value: &P::Output,
prop: P
) -> Result<usize, usize>
where
P: PropGet<K>,
for<'a> &'a T: IntoOwned<K>,
P::Output: Ord;
}
Expand description
Extension trait for slices.
See the module documentation for examples.
Required Methods
sourcefn is_sorted_by_prop<P, K>(&self, prop: P) -> boolwhere
P: PropGet<K>,
for<'a> &'a T: IntoOwned<K>,
P::Output: Ord,
fn is_sorted_by_prop<P, K>(&self, prop: P) -> boolwhere
P: PropGet<K>,
for<'a> &'a T: IntoOwned<K>,
P::Output: Ord,
Returns true
if a slice is sorted according to a property, otherwise, returns false
.
sourcefn sort_by_prop<P, K>(&mut self, prop: P)where
P: PropGet<K>,
for<'a> &'a T: IntoOwned<K>,
P::Output: Ord,
fn sort_by_prop<P, K>(&mut self, prop: P)where
P: PropGet<K>,
for<'a> &'a T: IntoOwned<K>,
P::Output: Ord,
Sort a slice using a property.
This functions calls slice::sort_by_key
.
sourcefn sort_unstable_by_prop<P, K>(&mut self, prop: P)where
P: PropGet<K>,
for<'a> &'a T: IntoOwned<K>,
P::Output: Ord,
fn sort_unstable_by_prop<P, K>(&mut self, prop: P)where
P: PropGet<K>,
for<'a> &'a T: IntoOwned<K>,
P::Output: Ord,
Sort a slice using a property.
This functions calls slice::sort_unstable_by_key
.