Skip to main content

PlaceholderMap

Struct PlaceholderMap 

Source
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>
where S: Default, A: Allocator + Default,

Source

pub fn new() -> Self

Source

pub fn with_key_capacity(capacity: usize) -> Self

Source

pub fn with_value_capacity(capacity: usize) -> Self

Source

pub fn with_key_value_capacity( key_capacity: usize, value_capacity: usize, ) -> Self

Source§

impl<K, V, S, A> PlaceholderMap<K, V, S, A>
where S: Default, A: Allocator + Clone,

Source

pub fn new_in(alloc: A) -> Self

Source

pub fn with_key_capacity_in(capacity: usize, alloc: A) -> Self

Source

pub fn with_value_capacity_in(capacity: usize, alloc: A) -> Self

Source

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>
where S: Clone, A: Allocator + Default,

Source

pub fn with_hasher(hash_builder: S) -> Self

Source

pub fn with_key_capacity_and_hasher(capacity: usize, hash_builder: S) -> Self

Source

pub fn with_value_capacity_and_hasher(capacity: usize, hash_builder: S) -> Self

Source

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>
where S: Clone, A: Allocator + Clone,

Source

pub fn with_hasher_in(hash_builder: S, alloc: A) -> Self

Source

pub fn with_key_capacity_and_hasher_in( capacity: usize, hash_builder: S, alloc: A, ) -> Self

Source

pub fn with_value_capacity_and_hasher_in( capacity: usize, hash_builder: S, alloc: A, ) -> Self

Source

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,

Source

pub fn key_allocator(&self) -> &A

Source

pub fn value_allocator(&self) -> &A

Source

pub fn key_hasher(&self) -> &S

Source

pub fn value_hasher(&self) -> &S

Source

pub fn key_capacity(&self) -> usize

Source

pub fn value_capacity(&self) -> usize

Source

pub fn keys(&self) -> Keys<'_, K, V> ⓘ

Source

pub fn values(&self) -> Values<'_, V> ⓘ

Source

pub fn iter(&self) -> Iter<'_, K, V> ⓘ

Source

pub fn len(&self) -> usize

Source

pub fn values_len(&self) -> usize

Source

pub fn is_empty(&self) -> bool

Source

pub fn clear(&mut self)

Source

pub fn into_keys(self) -> IntoKeys<K, V, A> ⓘ

Source

pub fn into_values(self) -> IntoValues<V, A> ⓘ

Source§

impl<K, V, S, A> PlaceholderMap<K, V, S, A>
where K: Eq + Hash, S: BuildHasher, A: Allocator,

Source

pub fn reserve_keys(&mut self, additional: usize)

Source

pub fn try_reserve_keys( &mut self, additional: usize, ) -> Result<(), TryReserveError>

Source

pub fn shrink_keys_to(&mut self, min_capacity: usize)

Source

pub fn shrink_keys_to_fit(&mut self)

Source

pub fn get<Q>(&self, k: &Q) -> Option<&V>
where Q: Hash + Equivalent<K> + ?Sized,

Source

pub fn get_key_value<Q>(&self, k: &Q) -> Option<(&K, &V)>
where Q: Hash + Equivalent<K> + ?Sized,

Source

pub fn contains_key<Q>(&self, k: &Q) -> bool
where Q: Hash + Equivalent<K> + ?Sized,

Source§

impl<K, V, S, A> PlaceholderMap<K, V, S, A>
where V: Eq + Hash, S: BuildHasher, A: Allocator,

Source

pub fn reserve_values(&mut self, additional: usize)

Source

pub fn try_reserve_values( &mut self, additional: usize, ) -> Result<(), TryReserveError>

Source

pub fn shrink_values_to(&mut self, min_capacity: usize)

Source

pub fn shrink_values_to_fit(&mut self)

Source§

impl<K, V, S, A> PlaceholderMap<K, V, S, A>
where K: Eq + Hash, V: Eq + Hash, S: BuildHasher, A: Allocator,

Source

pub fn reserve_keys_values( &mut self, additional_keys: usize, additional_values: usize, )

Source

pub fn try_reserve_keys_values( &mut self, additional_keys: usize, additional_values: usize, ) -> Result<(), TryReserveKeysValuesError>

Source

pub fn shrink_keys_values_to( &mut self, min_capacity_keys: usize, min_capacity_values: usize, )

Source

pub fn shrink_keys_values_to_fit(&mut self)

Source

pub fn insert(&mut self, k: K, v: V) -> &V

Source

pub fn insert_value_ref(&mut self, k: K, v: &V) -> &V
where V: Clone,

Same as insert(), except takes a reference to value, and clones it if the value isn’t already present in the map

Source

pub unsafe fn insert_unique_unchecked(&mut self, k: K, v: V) -> (&K, &V)

§Safety

See safety docs of [hashbrown::HashMap::insert_unique_unchecked]

Source

pub fn try_insert(&mut self, k: K, v: V) -> Result<&V, ()>

Source

pub fn remove<Q>(&mut self, k: &Q) -> Option<V>
where Q: Hash + Equivalent<K> + ?Sized,

Removes a key from the map, returning the value at the key if the key was the last key to point at the value

Source

pub fn remove_entry<Q>(&mut self, k: &Q) -> Option<(K, Option<V>)>
where Q: Hash + Equivalent<K> + ?Sized,

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

Source

pub fn allocation_size(&self) -> usize

Trait Implementations§

Source§

impl<K, V, S, A> Clone for PlaceholderMap<K, V, S, A>
where K: Eq + Hash + Clone, V: Eq + Hash + Clone, S: BuildHasher + Clone, A: Allocator + Clone,

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<K, V, S, A> Debug for PlaceholderMap<K, V, S, A>
where K: Debug, V: Debug, A: Allocator,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<K, V> Default for PlaceholderMap<K, V>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'h, K, V, S, A> Extend<&'h (K, V)> for PlaceholderMap<K, V, S, A>
where K: Eq + Hash + Clone, V: Eq + Hash + Clone, S: BuildHasher, A: Allocator,

Source§

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)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
Source§

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>
where K: Eq + Hash + Clone, V: Eq + Hash + Clone, S: BuildHasher, A: Allocator,

Source§

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)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
Source§

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>
where K: Eq + Hash, V: Eq + Hash, S: BuildHasher, A: Allocator,

Source§

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)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
Source§

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> From<Vec<(K, V)>> for PlaceholderMap<K, V, S, A>
where K: Eq + Hash, V: Eq + Hash, S: Default + BuildHasher, A: Default + Allocator,

Source§

fn from(value: Vec<(K, V)>) -> Self

Converts to this type from the input type.
Source§

impl<K, V, S, A, const N: usize> From<[(K, V); N]> for PlaceholderMap<K, V, S, A>
where K: Eq + Hash, V: Eq + Hash, S: Default + BuildHasher, A: Default + Allocator,

Source§

fn from(value: [(K, V); N]) -> Self

Converts to this type from the input type.
Source§

impl<K, V, S, A> Send for PlaceholderMap<K, V, S, A>
where K: Send, V: Send, S: Send, A: Allocator + Send,

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>
where HashMap<K, RcMut<V>, S, A>: Freeze, HashMap<RcMut<V>, (), S, A>: Freeze,

§

impl<K, V, S, A> Unpin for PlaceholderMap<K, V, S, A>
where HashMap<K, RcMut<V>, S, A>: Unpin, HashMap<RcMut<V>, (), S, A>: Unpin,

§

impl<K, V, S, A> UnsafeUnpin for PlaceholderMap<K, V, S, A>
where HashMap<K, RcMut<V>, S, A>: UnsafeUnpin, HashMap<RcMut<V>, (), S, A>: UnsafeUnpin,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.