Trait rs_std_ext::vec::VecExt
source · pub trait VecExt<T> {
// Required methods
fn sorted(self) -> Self
where T: Ord;
fn sorted_by(self, compare: impl FnMut(&T, &T) -> Ordering) -> Self;
fn sorted_by_key<K>(self, f: impl FnMut(&T) -> K) -> Self
where K: Ord;
fn sorted_by_cached_key<K>(self, f: impl FnMut(&T) -> K) -> Self
where K: Ord;
fn sorted_unstable(self) -> Self
where T: Ord;
fn sorted_unstable_by(self, compare: impl FnMut(&T, &T) -> Ordering) -> Self;
fn sorted_unstable_by_key<K>(self, f: impl FnMut(&T) -> K) -> Self
where K: Ord;
fn reversed(self) -> Self;
}Expand description
Extension methods for std::vec::Vec.
Required Methods§
sourcefn sorted(self) -> Selfwhere
T: Ord,
fn sorted(self) -> Selfwhere
T: Ord,
Same behaviour as Vec::sort,
but returns itself in a form consistent with chained calls.
sourcefn sorted_by(self, compare: impl FnMut(&T, &T) -> Ordering) -> Self
fn sorted_by(self, compare: impl FnMut(&T, &T) -> Ordering) -> Self
Same behaviour as Vec::sort_by,
but returns itself in a form consistent with chained calls.
sourcefn sorted_by_key<K>(self, f: impl FnMut(&T) -> K) -> Selfwhere
K: Ord,
fn sorted_by_key<K>(self, f: impl FnMut(&T) -> K) -> Selfwhere
K: Ord,
Same behaviour as Vec::sort_by_key,
but returns itself in a form consistent with chained calls.
sourcefn sorted_by_cached_key<K>(self, f: impl FnMut(&T) -> K) -> Selfwhere
K: Ord,
fn sorted_by_cached_key<K>(self, f: impl FnMut(&T) -> K) -> Selfwhere
K: Ord,
Same behaviour as Vec::sort_by_cached_key,
but returns itself in a form consistent with chained calls.
sourcefn sorted_unstable(self) -> Selfwhere
T: Ord,
fn sorted_unstable(self) -> Selfwhere
T: Ord,
Same behaviour as Vec::sort_unstable,
but returns itself in a form consistent with chained calls.
sourcefn sorted_unstable_by(self, compare: impl FnMut(&T, &T) -> Ordering) -> Self
fn sorted_unstable_by(self, compare: impl FnMut(&T, &T) -> Ordering) -> Self
Same behaviour as Vec::sort_unstable_by,
but returns itself in a form consistent with chained calls.
sourcefn sorted_unstable_by_key<K>(self, f: impl FnMut(&T) -> K) -> Selfwhere
K: Ord,
fn sorted_unstable_by_key<K>(self, f: impl FnMut(&T) -> K) -> Selfwhere
K: Ord,
Same behaviour as Vec::sort_unstable_by_key,
but returns itself in a form consistent with chained calls.
sourcefn reversed(self) -> Self
fn reversed(self) -> Self
Same behaviour as Vec::reverse,
but returns itself in a form consistent with chained calls.