Skip to main content

PreventDuplicateInsertsSet

Trait PreventDuplicateInsertsSet 

Source
pub trait PreventDuplicateInsertsSet<T> {
    // Required methods
    fn new(size_hint: Option<usize>) -> Self;
    fn insert(&mut self, value: T) -> bool;
}

Required Methods§

Source

fn new(size_hint: Option<usize>) -> Self

Source

fn insert(&mut self, value: T) -> bool

Return true if the insert was successful and the value did not exist in the set

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.

Implementors§

Source§

impl<T> PreventDuplicateInsertsSet<T> for BTreeSet<T>
where T: Ord,

Source§

impl<T, S> PreventDuplicateInsertsSet<T> for HashSet<T, S>
where T: Eq + Hash, S: BuildHasher + Default,

Available on crate feature std only.