Trait fera_graph::ext::GraphsSliceExt
[−]
[src]
pub trait GraphsSliceExt<T> { fn is_sorted_by_prop<P, K>(&self, prop: P) -> bool
where
P: PropGet<K>,
&'a T: IntoOwned<K>,
P::Output: Ord; fn sort_by_prop<P, K>(&mut self, prop: P)
where
P: PropGet<K>,
&'a T: IntoOwned<K>,
P::Output: Ord; fn sort_unstable_by_prop<P, K>(&mut self, prop: P)
where
P: PropGet<K>,
&'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>,
&'a T: IntoOwned<K>,
P::Output: Ord; }
Extension trait for slices.
See the module documentation for examples.
Required Methods
fn is_sorted_by_prop<P, K>(&self, prop: P) -> bool where
P: PropGet<K>,
&'a T: IntoOwned<K>,
P::Output: Ord,
P: PropGet<K>,
&'a T: IntoOwned<K>,
P::Output: Ord,
Returns true
if a slice is sorted according to a property, otherwise, returns false
.
fn sort_by_prop<P, K>(&mut self, prop: P) where
P: PropGet<K>,
&'a T: IntoOwned<K>,
P::Output: Ord,
P: PropGet<K>,
&'a T: IntoOwned<K>,
P::Output: Ord,
Sort a slice using a property.
This functions calls slice::sort_by_key
.
fn sort_unstable_by_prop<P, K>(&mut self, prop: P) where
P: PropGet<K>,
&'a T: IntoOwned<K>,
P::Output: Ord,
P: PropGet<K>,
&'a T: IntoOwned<K>,
P::Output: Ord,
Sort a slice using a property.
This functions calls slice::sort_unstable_by_key
.
fn binary_search_by_prop<P, K>(
&self,
prop_value: &P::Output,
prop: P
) -> Result<usize, usize> where
P: PropGet<K>,
&'a T: IntoOwned<K>,
P::Output: Ord,
&self,
prop_value: &P::Output,
prop: P
) -> Result<usize, usize> where
P: PropGet<K>,
&'a T: IntoOwned<K>,
P::Output: Ord,
Binary searches a slice that is sorted by a property.
This functions calls slice::binary_search_by_key
.
Implementations on Foreign Types
impl<T> GraphsSliceExt<T> for [T]
[src]
fn is_sorted_by_prop<P, K>(&self, prop: P) -> bool where
P: PropGet<K>,
&'a T: IntoOwned<K>,
P::Output: Ord,
[src]
P: PropGet<K>,
&'a T: IntoOwned<K>,
P::Output: Ord,
fn sort_by_prop<P, K>(&mut self, prop: P) where
P: PropGet<K>,
&'a T: IntoOwned<K>,
P::Output: Ord,
[src]
P: PropGet<K>,
&'a T: IntoOwned<K>,
P::Output: Ord,
fn sort_unstable_by_prop<P, K>(&mut self, prop: P) where
P: PropGet<K>,
&'a T: IntoOwned<K>,
P::Output: Ord,
[src]
P: PropGet<K>,
&'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>,
&'a T: IntoOwned<K>,
P::Output: Ord,
[src]
&self,
prop_value: &P::Output,
prop: P
) -> Result<usize, usize> where
P: PropGet<K>,
&'a T: IntoOwned<K>,
P::Output: Ord,