pub struct KeyedSet<T, Extractor, S = DefaultHashBuilder> { /* private fields */ }Implementations§
source§impl<T, Extractor> KeyedSet<T, Extractor>where
Extractor: for<'a> KeyExtractor<'a, T>,
for<'a> <Extractor as KeyExtractor<'a, T>>::Key: Hash,
impl<T, Extractor> KeyedSet<T, Extractor>where Extractor: for<'a> KeyExtractor<'a, T>, for<'a> <Extractor as KeyExtractor<'a, T>>::Key: Hash,
source§impl<T, Extractor, S> KeyedSet<T, Extractor, S>where
Extractor: for<'a> KeyExtractor<'a, T>,
for<'a> <Extractor as KeyExtractor<'a, T>>::Key: Hash,
S: BuildHasher,
impl<T, Extractor, S> KeyedSet<T, Extractor, S>where Extractor: for<'a> KeyExtractor<'a, T>, for<'a> <Extractor as KeyExtractor<'a, T>>::Key: Hash, S: BuildHasher,
pub fn insert(&mut self, value: T) -> Option<T>where for<'a, 'b> <Extractor as KeyExtractor<'a, T>>::Key: PartialEq<<Extractor as KeyExtractor<'b, T>>::Key>,
pub fn entry<'a, K>(&'a mut self, key: K) -> Entry<'a, T, Extractor, K, S>where K: Hash, for<'z> <Extractor as KeyExtractor<'z, T>>::Key: Hash + PartialEq<K>,
pub fn write(&mut self, value: T) -> &mut Twhere for<'a, 'b> <Extractor as KeyExtractor<'a, T>>::Key: PartialEq<<Extractor as KeyExtractor<'b, T>>::Key>,
pub fn get<K>(&self, key: &K) -> Option<&T>where K: Hash, for<'a> <Extractor as KeyExtractor<'a, T>>::Key: Hash + PartialEq<K>,
pub fn get_mut<'a, K>( &'a mut self, key: &'a K ) -> Option<KeyedSetGuard<'a, K, T, Extractor>>where K: Hash, for<'z> <Extractor as KeyExtractor<'z, T>>::Key: Hash + PartialEq<K>,
pub fn get_mut_unguarded<'a, K>(&'a mut self, key: &K) -> Option<&'a mut T>where K: Hash, for<'z> <Extractor as KeyExtractor<'z, T>>::Key: Hash + PartialEq<K>,
pub fn remove<K>(&mut self, key: &K) -> Option<T>where K: Hash, for<'z> <Extractor as KeyExtractor<'z, T>>::Key: Hash + PartialEq<K>,
sourcepub fn drain_where<F: FnMut(&mut T) -> bool>(
&mut self,
predicate: F
) -> DrainFilter<'_, T, F> ⓘ
pub fn drain_where<F: FnMut(&mut T) -> bool>( &mut self, predicate: F ) -> DrainFilter<'_, T, F> ⓘ
Returns an iterator that drains elements that match the provided predicate, while removing them from the set.
Note that DrainFilter WILL iterate fully on drop, ensuring that all elements matching your predicate are always removed, even if you fail to iterate.