pub struct PlaceholderMap<K, V, S = DefaultHashBuilder, A = Global>where
A: Allocator,{ /* private fields */ }Implementations§
Source§impl<K, V, S, A> PlaceholderMap<K, V, S, A>
impl<K, V, S, A> PlaceholderMap<K, V, S, A>
pub fn new() -> Self
pub fn with_key_capacity(capacity: usize) -> Self
pub fn with_value_capacity(capacity: usize) -> Self
pub fn with_key_value_capacity( key_capacity: usize, value_capacity: usize, ) -> Self
Source§impl<K, V, S, A> PlaceholderMap<K, V, S, A>
impl<K, V, S, A> PlaceholderMap<K, V, S, A>
pub fn new_in(alloc: A) -> Self
pub fn with_key_capacity_in(capacity: usize, alloc: A) -> Self
pub fn with_value_capacity_in(capacity: usize, alloc: A) -> Self
pub fn with_key_value_capacity_in( key_capacity: usize, value_capacity: usize, alloc: A, ) -> Self
Source§impl<K, V, S, A> PlaceholderMap<K, V, S, A>
impl<K, V, S, A> PlaceholderMap<K, V, S, A>
pub fn with_hasher(hash_builder: S) -> Self
pub fn with_key_capacity_and_hasher(capacity: usize, hash_builder: S) -> Self
pub fn with_value_capacity_and_hasher(capacity: usize, hash_builder: S) -> Self
pub fn with_key_value_capacity_and_hasher( key_capacity: usize, value_capacity: usize, hash_builder: S, ) -> Self
Source§impl<K, V, S, A> PlaceholderMap<K, V, S, A>
impl<K, V, S, A> PlaceholderMap<K, V, S, A>
pub fn with_hasher_in(hash_builder: S, alloc: A) -> Self
pub fn with_key_capacity_and_hasher_in( capacity: usize, hash_builder: S, alloc: A, ) -> Self
pub fn with_value_capacity_and_hasher_in( capacity: usize, hash_builder: S, alloc: A, ) -> Self
pub fn with_key_value_capacity_and_hasher_in( key_capacity: usize, value_capacity: usize, hash_builder: S, alloc: A, ) -> Self
Source§impl<K, V, S, A> PlaceholderMap<K, V, S, A>where
A: Allocator,
impl<K, V, S, A> PlaceholderMap<K, V, S, A>where
A: Allocator,
pub fn key_allocator(&self) -> &A
pub fn value_allocator(&self) -> &A
pub fn key_hasher(&self) -> &S
pub fn value_hasher(&self) -> &S
pub fn key_capacity(&self) -> usize
pub fn value_capacity(&self) -> usize
pub fn keys(&self) -> Keys<'_, K, V> ⓘ
pub fn values(&self) -> Values<'_, V> ⓘ
pub fn iter(&self) -> Iter<'_, K, V> ⓘ
pub fn len(&self) -> usize
pub fn values_len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn clear(&mut self)
pub fn into_keys(self) -> IntoKeys<K, V, A> ⓘ
pub fn into_values(self) -> IntoValues<V, A> ⓘ
Source§impl<K, V, S, A> PlaceholderMap<K, V, S, A>
impl<K, V, S, A> PlaceholderMap<K, V, S, A>
pub fn reserve_keys(&mut self, additional: usize)
pub fn try_reserve_keys( &mut self, additional: usize, ) -> Result<(), TryReserveError>
pub fn shrink_keys_to(&mut self, min_capacity: usize)
pub fn shrink_keys_to_fit(&mut self)
pub fn get<Q>(&self, k: &Q) -> Option<&V>
pub fn get_key_value<Q>(&self, k: &Q) -> Option<(&K, &V)>
pub fn contains_key<Q>(&self, k: &Q) -> bool
Source§impl<K, V, S, A> PlaceholderMap<K, V, S, A>
impl<K, V, S, A> PlaceholderMap<K, V, S, A>
pub fn reserve_values(&mut self, additional: usize)
pub fn try_reserve_values( &mut self, additional: usize, ) -> Result<(), TryReserveError>
pub fn shrink_values_to(&mut self, min_capacity: usize)
pub fn shrink_values_to_fit(&mut self)
Source§impl<K, V, S, A> PlaceholderMap<K, V, S, A>
impl<K, V, S, A> PlaceholderMap<K, V, S, A>
pub fn reserve_keys_values( &mut self, additional_keys: usize, additional_values: usize, )
pub fn try_reserve_keys_values( &mut self, additional_keys: usize, additional_values: usize, ) -> Result<(), TryReserveKeysValuesError>
pub fn shrink_keys_values_to( &mut self, min_capacity_keys: usize, min_capacity_values: usize, )
pub fn shrink_keys_values_to_fit(&mut self)
pub fn insert(&mut self, k: K, v: V) -> &V
Sourcepub fn insert_value_ref(&mut self, k: K, v: &V) -> &Vwhere
V: Clone,
pub fn insert_value_ref(&mut self, k: K, v: &V) -> &Vwhere
V: Clone,
Same as insert(), except takes a reference to value, and
clones it if the value isn’t already present in the map
Sourcepub unsafe fn insert_unique_unchecked(&mut self, k: K, v: V) -> (&K, &V)
pub unsafe fn insert_unique_unchecked(&mut self, k: K, v: V) -> (&K, &V)
§Safety
See safety docs of [hashbrown::HashMap::insert_unique_unchecked]
pub fn try_insert(&mut self, k: K, v: V) -> Result<&V, ()>
Sourcepub fn remove<Q>(&mut self, k: &Q) -> Option<V>
pub fn remove<Q>(&mut self, k: &Q) -> Option<V>
Removes a key from the map, returning the value at the key if the key was the last key to point at the value
Sourcepub fn remove_entry<Q>(&mut self, k: &Q) -> Option<(K, Option<V>)>
pub fn remove_entry<Q>(&mut self, k: &Q) -> Option<(K, Option<V>)>
Removes a key from the map, returning the stored key if the key was previously in the map, and the value at the key if the key was the last key to point at the value
pub fn allocation_size(&self) -> usize
Trait Implementations§
Source§impl<K, V, S, A> Clone for PlaceholderMap<K, V, S, A>
impl<K, V, S, A> Clone for PlaceholderMap<K, V, S, A>
Source§impl<K, V, S, A> Debug for PlaceholderMap<K, V, S, A>
impl<K, V, S, A> Debug for PlaceholderMap<K, V, S, A>
Source§impl<K, V> Default for PlaceholderMap<K, V>
impl<K, V> Default for PlaceholderMap<K, V>
Source§impl<'h, K, V, S, A> Extend<&'h (K, V)> for PlaceholderMap<K, V, S, A>
impl<'h, K, V, S, A> Extend<&'h (K, V)> for PlaceholderMap<K, V, S, A>
Source§fn extend<T: IntoIterator<Item = &'h (K, V)>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = &'h (K, V)>>(&mut self, iter: T)
Extends a collection with the contents of an iterator. Read more
Source§fn extend_one(&mut self, item: T)
fn extend_one(&mut self, item: T)
🔬This is a nightly-only experimental API. (
extend_one)Extends a collection with exactly one element.
Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one)Reserves capacity in a collection for the given number of additional elements. Read more
Source§impl<'h, K, V, S, A> Extend<(&'h K, &'h V)> for PlaceholderMap<K, V, S, A>
impl<'h, K, V, S, A> Extend<(&'h K, &'h V)> for PlaceholderMap<K, V, S, A>
Source§fn extend<T: IntoIterator<Item = (&'h K, &'h V)>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = (&'h K, &'h V)>>(&mut self, iter: T)
Extends a collection with the contents of an iterator. Read more
Source§fn extend_one(&mut self, item: T)
fn extend_one(&mut self, item: T)
🔬This is a nightly-only experimental API. (
extend_one)Extends a collection with exactly one element.
Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one)Reserves capacity in a collection for the given number of additional elements. Read more
Source§impl<K, V, S, A> Extend<(K, V)> for PlaceholderMap<K, V, S, A>
impl<K, V, S, A> Extend<(K, V)> for PlaceholderMap<K, V, S, A>
Source§fn extend<T: IntoIterator<Item = (K, V)>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = (K, V)>>(&mut self, iter: T)
Extends a collection with the contents of an iterator. Read more
Source§fn extend_one(&mut self, item: T)
fn extend_one(&mut self, item: T)
🔬This is a nightly-only experimental API. (
extend_one)Extends a collection with exactly one element.
Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one)Reserves capacity in a collection for the given number of additional elements. Read more
impl<K, V, S, A> Send for PlaceholderMap<K, V, S, A>
Auto Trait Implementations§
impl<K, V, S = DefaultHashBuilder, A = Global> !RefUnwindSafe for PlaceholderMap<K, V, S, A>
impl<K, V, S = DefaultHashBuilder, A = Global> !Sync for PlaceholderMap<K, V, S, A>
impl<K, V, S = DefaultHashBuilder, A = Global> !UnwindSafe for PlaceholderMap<K, V, S, A>
impl<K, V, S, A> Freeze for PlaceholderMap<K, V, S, A>
impl<K, V, S, A> Unpin for PlaceholderMap<K, V, S, A>
impl<K, V, S, A> UnsafeUnpin for PlaceholderMap<K, V, S, A>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more