pub trait TrySort<T> {
// Required methods
fn try_sort_by<F>(&mut self, compare: F) -> OrderResult<()>
where F: FnMut(&T, &T) -> Option<bool>;
fn try_sort_by_cached_key<K, F>(&mut self, f: F) -> OrderResult<()>
where F: FnMut(&T) -> Option<K>,
K: PartialOrd<K>;
fn try_sort_unstable_by<F>(&mut self, compare: F) -> OrderResult<()>
where F: FnMut(&T, &T) -> Option<bool>;
fn try_is_sorted_by<F>(&self, compare: F) -> OrderResult<bool>
where F: FnMut(&T, &T) -> Option<bool>;
// Provided methods
fn try_sort(&mut self) -> OrderResult<()>
where T: PartialOrd<T> { ... }
fn try_sort_by_key<K, F>(&mut self, f: F) -> OrderResult<()>
where F: FnMut(&T) -> Option<K>,
K: PartialOrd<K> { ... }
fn try_sort_unstable(&mut self) -> OrderResult<()>
where T: PartialOrd<T> { ... }
fn try_sort_unstable_by_key<K, F>(&mut self, f: F) -> OrderResult<()>
where F: FnMut(&T) -> Option<K>,
K: PartialOrd<K> { ... }
fn try_is_sorted(&self) -> OrderResult<bool>
where T: PartialOrd<T> { ... }
fn try_is_sorted_by_key<K, F>(&mut self, f: F) -> OrderResult<bool>
where F: FnMut(&T) -> Option<K>,
K: PartialOrd<K> { ... }
}Expand description
Sort methods for PartialOrd.
Required Methods§
Sourcefn try_sort_by<F>(&mut self, compare: F) -> OrderResult<()>
fn try_sort_by<F>(&mut self, compare: F) -> OrderResult<()>
PartialOrd version for slice::sort_by
Sourcefn try_sort_by_cached_key<K, F>(&mut self, f: F) -> OrderResult<()>
fn try_sort_by_cached_key<K, F>(&mut self, f: F) -> OrderResult<()>
PartialOrd version for slice::sort_by_cached_key
Sourcefn try_sort_unstable_by<F>(&mut self, compare: F) -> OrderResult<()>
fn try_sort_unstable_by<F>(&mut self, compare: F) -> OrderResult<()>
PartialOrd version for slice::sort_unstable_by
Sourcefn try_is_sorted_by<F>(&self, compare: F) -> OrderResult<bool>
fn try_is_sorted_by<F>(&self, compare: F) -> OrderResult<bool>
PartialOrd version for slice::is_sorted_by
Provided Methods§
Sourcefn try_sort(&mut self) -> OrderResult<()>where
T: PartialOrd<T>,
fn try_sort(&mut self) -> OrderResult<()>where
T: PartialOrd<T>,
PartialOrd version for slice::sort
Sourcefn try_sort_by_key<K, F>(&mut self, f: F) -> OrderResult<()>
fn try_sort_by_key<K, F>(&mut self, f: F) -> OrderResult<()>
PartialOrd version for slice::sort_by_key
Sourcefn try_sort_unstable(&mut self) -> OrderResult<()>where
T: PartialOrd<T>,
fn try_sort_unstable(&mut self) -> OrderResult<()>where
T: PartialOrd<T>,
PartialOrd version for slice::sort_unstable
Sourcefn try_sort_unstable_by_key<K, F>(&mut self, f: F) -> OrderResult<()>
fn try_sort_unstable_by_key<K, F>(&mut self, f: F) -> OrderResult<()>
PartialOrd version for slice::sort_unstable_by_key
Sourcefn try_is_sorted(&self) -> OrderResult<bool>where
T: PartialOrd<T>,
fn try_is_sorted(&self) -> OrderResult<bool>where
T: PartialOrd<T>,
PartialOrd version for slice::is_sorted
Sourcefn try_is_sorted_by_key<K, F>(&mut self, f: F) -> OrderResult<bool>
fn try_is_sorted_by_key<K, F>(&mut self, f: F) -> OrderResult<bool>
PartialOrd version for slice::is_sorted_by_key
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.