Trait AsImHashSet

Source
pub trait AsImHashSet<A: Hash + Eq + Clone>: Clone {
    // Required methods
    fn insert(&mut self, a: A) -> Option<A>;
    fn remove<BA>(&mut self, a: &BA) -> Option<A>
       where BA: Hash + Eq + ?Sized,
             A: Borrow<BA>;
    fn retain<F: FnMut(&A) -> bool>(&mut self, f: F);

    // Provided methods
    fn to_inserted(&mut self, a: A) -> (Self, Option<A>) { ... }
    fn to_removed<BA>(&self, a: &BA) -> (Self, Option<A>)
       where BA: Hash + Eq + ?Sized,
             A: Borrow<BA> { ... }
    fn to_retained<F: FnMut(&A) -> bool>(&self, f: F) -> Self { ... }
    fn to_extended<I: IntoIterator<Item = A>>(&self, iter: I) -> Self
       where Self: Extend<A> { ... }
    fn iter_clone(&self) -> Self::IntoIter
       where Self: IntoIterator { ... }
}

Required Methods§

Source

fn insert(&mut self, a: A) -> Option<A>

Source

fn remove<BA>(&mut self, a: &BA) -> Option<A>
where BA: Hash + Eq + ?Sized, A: Borrow<BA>,

Source

fn retain<F: FnMut(&A) -> bool>(&mut self, f: F)

Provided Methods§

Source

fn to_inserted(&mut self, a: A) -> (Self, Option<A>)

Source

fn to_removed<BA>(&self, a: &BA) -> (Self, Option<A>)
where BA: Hash + Eq + ?Sized, A: Borrow<BA>,

Source

fn to_retained<F: FnMut(&A) -> bool>(&self, f: F) -> Self

Source

fn to_extended<I: IntoIterator<Item = A>>(&self, iter: I) -> Self
where Self: Extend<A>,

Source

fn iter_clone(&self) -> Self::IntoIter
where Self: IntoIterator,

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<A: Hash + Eq + Clone, S: BuildHasher> AsImHashSet<A> for HashSet<A, S>

Source§

fn insert(&mut self, a: A) -> Option<A>

Source§

fn remove<BA>(&mut self, a: &BA) -> Option<A>
where BA: Hash + Eq + ?Sized, A: Borrow<BA>,

Source§

fn retain<F: FnMut(&A) -> bool>(&mut self, f: F)

Implementors§