pub trait OrdSignature: EqSignature {
// Required method
fn cmp(&self, a: &Self::Set, b: &Self::Set) -> Ordering;
// Provided methods
fn is_sorted(&self, a: &[impl Borrow<Self::Set>]) -> bool { ... }
fn is_sorted_by_key<X>(
&self,
a: &[X],
key: impl Fn(&X) -> &Self::Set,
) -> bool { ... }
fn is_sorted_and_unique(&self, a: &[impl Borrow<Self::Set>]) -> bool { ... }
fn is_sorted_and_unique_by_key<X>(
&self,
a: &[X],
key: impl Fn(&X) -> &Self::Set,
) -> bool { ... }
fn binary_search(
&self,
v: &[impl Borrow<Self::Set>],
target: &Self::Set,
) -> bool { ... }
fn binary_search_by_key<'x, X>(
&self,
v: &'x [X],
target: &Self::Set,
key: impl Fn(&X) -> &Self::Set,
) -> Option<&'x X> { ... }
fn merge_sorted<'s, S: Borrow<Self::Set> + 's>(
&'s self,
a: Vec<S>,
b: Vec<S>,
) -> impl Iterator<Item = (MergedSource, S)> { ... }
fn merge_sorted_by_key<X>(
&self,
a: Vec<X>,
b: Vec<X>,
key: impl Fn(&X) -> &Self::Set,
) -> impl Iterator<Item = (MergedSource, X)> { ... }
fn sort<S: Borrow<Self::Set>>(&self, a: Vec<S>) -> Vec<S> { ... }
fn sort_by_key<X>(
&self,
a: Vec<X>,
key: &impl Fn(&X) -> &Self::Set,
) -> Vec<X> { ... }
fn sort_by_cached_by<X: 'static>(
&self,
a: Vec<X>,
key: impl Fn(&X) -> Self::Set,
) -> Vec<X>
where Self::Set: 'static { ... }
}Required Methods§
Provided Methods§
fn is_sorted(&self, a: &[impl Borrow<Self::Set>]) -> bool
fn is_sorted_by_key<X>(&self, a: &[X], key: impl Fn(&X) -> &Self::Set) -> bool
fn is_sorted_and_unique(&self, a: &[impl Borrow<Self::Set>]) -> bool
fn is_sorted_and_unique_by_key<X>( &self, a: &[X], key: impl Fn(&X) -> &Self::Set, ) -> bool
fn binary_search( &self, v: &[impl Borrow<Self::Set>], target: &Self::Set, ) -> bool
fn binary_search_by_key<'x, X>( &self, v: &'x [X], target: &Self::Set, key: impl Fn(&X) -> &Self::Set, ) -> Option<&'x X>
fn merge_sorted<'s, S: Borrow<Self::Set> + 's>( &'s self, a: Vec<S>, b: Vec<S>, ) -> impl Iterator<Item = (MergedSource, S)>
fn merge_sorted_by_key<X>( &self, a: Vec<X>, b: Vec<X>, key: impl Fn(&X) -> &Self::Set, ) -> impl Iterator<Item = (MergedSource, X)>
fn sort<S: Borrow<Self::Set>>(&self, a: Vec<S>) -> Vec<S>
fn sort_by_key<X>(&self, a: Vec<X>, key: &impl Fn(&X) -> &Self::Set) -> Vec<X>
fn sort_by_cached_by<X: 'static>(
&self,
a: Vec<X>,
key: impl Fn(&X) -> Self::Set,
) -> Vec<X>where
Self::Set: 'static,
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.