Rdedup

Trait Rdedup 

pub trait Rdedup {
    type Item;

    // Required method
    fn rdedup_by_key<K, F>(&mut self, key: F)
       where F: Fn(&mut Self::Item) -> K,
             K: PartialEq;
}
Expand description

A variant of dedup that keeps the later value rather than the earlier one.

Required Associated Types§

type Item

Required Methods§

fn rdedup_by_key<K, F>(&mut self, key: F)
where F: Fn(&mut Self::Item) -> K, K: PartialEq,

Deduplicates values in a sorted sequence using a key function, but unlike the standard version keeps the later one.

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§

§

impl<T, const N: usize> Rdedup for SmallVec<[T; N]>
where T: Copy,

§

type Item = T

§

fn rdedup_by_key<K, F>(&mut self, key: F)
where T: Copy, K: PartialEq, F: FnMut(&mut T) -> K,

Implementors§