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§

source

fn sorted(self) -> Self
where T: Ord,

Same behaviour as Vec::sort, but returns itself in a form consistent with chained calls.

source

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.

source

fn sorted_by_key<K>(self, f: impl FnMut(&T) -> K) -> Self
where K: Ord,

Same behaviour as Vec::sort_by_key, but returns itself in a form consistent with chained calls.

source

fn sorted_by_cached_key<K>(self, f: impl FnMut(&T) -> K) -> Self
where K: Ord,

Same behaviour as Vec::sort_by_cached_key, but returns itself in a form consistent with chained calls.

source

fn sorted_unstable(self) -> Self
where T: Ord,

Same behaviour as Vec::sort_unstable, but returns itself in a form consistent with chained calls.

source

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.

source

fn sorted_unstable_by_key<K>(self, f: impl FnMut(&T) -> K) -> Self
where K: Ord,

Same behaviour as Vec::sort_unstable_by_key, but returns itself in a form consistent with chained calls.

source

fn reversed(self) -> Self

Same behaviour as Vec::reverse, but returns itself in a form consistent with chained calls.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<T> VecExt<T> for Vec<T>

source§

fn sorted(self) -> Self
where T: Ord,

source§

fn sorted_by(self, compare: impl FnMut(&T, &T) -> Ordering) -> Self

source§

fn sorted_by_key<K>(self, f: impl FnMut(&T) -> K) -> Self
where K: Ord,

source§

fn sorted_by_cached_key<K>(self, f: impl FnMut(&T) -> K) -> Self
where K: Ord,

source§

fn sorted_unstable(self) -> Self
where T: Ord,

source§

fn sorted_unstable_by(self, compare: impl FnMut(&T, &T) -> Ordering) -> Self

source§

fn sorted_unstable_by_key<K>(self, f: impl FnMut(&T) -> K) -> Self
where K: Ord,

source§

fn reversed(self) -> Self

Implementors§