Trait Resort

Source
pub trait Resort<T>
where Self: Index<usize, Output = T>,
{ // Required method fn resort_element_by<F>(&mut self, index: usize, f: F) -> usize where F: FnMut(&T, &T) -> Ordering; // Provided method fn resort_element(&mut self, index: usize) -> usize where Self::Output: Ord { ... } }

Required Methods§

Source

fn resort_element_by<F>(&mut self, index: usize, f: F) -> usize
where F: FnMut(&T, &T) -> Ordering,

Provided Methods§

Source

fn resort_element(&mut self, index: usize) -> usize
where Self::Output: Ord,

Sort again already sorted sequence after the element at index changed. Returns new index.

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.

Implementations on Foreign Types§

Source§

impl<T: Ord> Resort<T> for Vec<T>

Source§

fn resort_element_by<F>(&mut self, index: usize, f: F) -> usize
where F: FnMut(&T, &T) -> Ordering,

Implementors§