pub trait HashSetLike<E>
where E: Eq + Hash,
{ // Required method fn insert(&mut self, element: E) -> Option<E>; }
Expand description

A trait for containers behaving like a HashSet, allowing insertion operations.

Implementing this trait enables the associated formed to be used with HashSetSubformer, facilitating a builder pattern that is both intuitive and concise.

§Example Implementation

Implementing HashSetLike for std::collections::HashSet:

Required Methods§

source

fn insert(&mut self, element: E) -> Option<E>

Inserts a key-value pair into the map.

Implementations on Foreign Types§

source§

impl<E> HashSetLike<E> for HashSet<E>
where E: Eq + Hash,

source§

fn insert(&mut self, element: E) -> Option<E>

Implementors§