pub trait WritableHashSetExt<V, H>: Writable<Target = HashSet<V, H>>where
V: 'static,
H: 'static,{
// Provided methods
fn clear(&mut self) { ... }
fn retain(&mut self, f: impl FnMut(&V) -> bool) { ... }
fn insert(&mut self, k: V) -> bool
where V: Eq + Hash,
H: BuildHasher { ... }
fn extend(&mut self, iter: impl IntoIterator<Item = V>)
where V: Eq + Hash,
H: BuildHasher { ... }
fn remove(&mut self, k: &V) -> bool
where V: Eq + Hash,
H: BuildHasher { ... }
}Available on crate feature
prelude only.Expand description
An extension trait for Writable<HashSet<V, H>> that provides some convenience methods.
Provided Methods§
Sourcefn retain(&mut self, f: impl FnMut(&V) -> bool)
fn retain(&mut self, f: impl FnMut(&V) -> bool)
Retain only the elements specified by the predicate.
Sourcefn insert(&mut self, k: V) -> bool
fn insert(&mut self, k: V) -> bool
Inserts a value into the set. Returns true if the value was not already present.
Sourcefn extend(&mut self, iter: impl IntoIterator<Item = V>)
fn extend(&mut self, iter: impl IntoIterator<Item = V>)
Extends the set with the values from the given iterator.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".