pub struct ReassignableCountedMap<K: HashIndex, V> { /* private fields */ }

Implementations§

source§

impl<K: HashIndex, V> ReassignableCountedMap<K, V>

source

pub fn new() -> Self

source

pub unsafe fn new_unsafe( hash_map: HashMap<K, V>, counter: RemovableCounter<K> ) -> Self

source

pub fn with_hasher(hash_builder: RandomState) -> Self

source

pub fn with_capacity(capacity: usize) -> Self

source

pub fn with_capacity_and_hasher( capacity: usize, hash_builder: RandomState ) -> Self

source

pub fn len(&self) -> usize

source

pub fn is_empty(&self) -> bool

source

pub fn capacity(&self) -> usize

source

pub fn clear(&mut self)

source

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

source

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

source

pub fn shrink_to_fit(&mut self)

source

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

source

pub fn drain(&mut self) -> Drain<'_, K, V>

source

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

source

pub fn iter_mut(&mut self) -> IterMut<'_, K, V>

source

pub fn contains_key(&self, key: &K) -> bool

source

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

source

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

source

pub fn values_mut(&mut self) -> ValuesMut<'_, K, V>

source

pub fn get_hash_map(&self) -> &HashMap<K, V>

source

pub unsafe fn get_hash_map_mut(&mut self) -> &mut HashMap<K, V>

source

pub fn extract_hash_map(self) -> HashMap<K, V>

source

pub fn get_counter(&self) -> &RemovableCounter<K>

source

pub unsafe fn get_counter_mut(&mut self) -> &mut RemovableCounter<K>

source

pub fn extract_counter(self) -> RemovableCounter<K>

source

pub fn extract(self) -> (HashMap<K, V>, RemovableCounter<K>)

source

pub fn push(&mut self, value: V) -> Result<K, HashMapFull>

source

pub fn get(&self, index: &K) -> Option<&V>

source

pub fn get_mut(&mut self, index: &K) -> Option<&mut V>

source

pub fn remove(&mut self, index: K) -> Option<V>

source

pub fn remove_entry(&mut self, index: K) -> Option<(K, V)>

Trait Implementations§

source§

impl<K: HashIndex, V> AsRef<HashMap<K, V>> for ReassignableCountedMap<K, V>

source§

fn as_ref(&self) -> &HashMap<K, V>

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<K: HashIndex, V> AsRef<RemovableCounter<K>> for ReassignableCountedMap<K, V>

source§

fn as_ref(&self) -> &RemovableCounter<K>

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<K: Clone + HashIndex, V: Clone> Clone for ReassignableCountedMap<K, V>

source§

fn clone(&self) -> ReassignableCountedMap<K, V>

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl<K: Debug + HashIndex, V: Debug> Debug for ReassignableCountedMap<K, V>

source§

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

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

impl<K: HashIndex, V> Default for ReassignableCountedMap<K, V>

source§

fn default() -> Self

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

impl<K: HashIndex, V> Index<&K> for ReassignableCountedMap<K, V>

§

type Output = V

The returned type after indexing.
source§

fn index(&self, index: &K) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
source§

impl<K: HashIndex, V> IndexMut<&K> for ReassignableCountedMap<K, V>

source§

fn index_mut(&mut self, index: &K) -> &mut Self::Output

Performs the mutable indexing (container[index]) operation. Read more
source§

impl<'a, K: HashIndex, V> IntoIterator for &'a ReassignableCountedMap<K, V>

§

type Item = (&'a K, &'a V)

The type of the elements being iterated over.
§

type IntoIter = Iter<'a, K, V>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl<'a, K: HashIndex, V> IntoIterator for &'a mut ReassignableCountedMap<K, V>

§

type Item = (&'a K, &'a mut V)

The type of the elements being iterated over.
§

type IntoIter = IterMut<'a, K, V>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl<K: HashIndex, V> IntoIterator for ReassignableCountedMap<K, V>

§

type Item = (K, V)

The type of the elements being iterated over.
§

type IntoIter = IntoIter<K, V>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl<K: PartialEq + HashIndex, V: PartialEq> PartialEq for ReassignableCountedMap<K, V>

source§

fn eq(&self, other: &ReassignableCountedMap<K, V>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<K: Eq + HashIndex, V: Eq> Eq for ReassignableCountedMap<K, V>

source§

impl<K: HashIndex, V> StructuralPartialEq for ReassignableCountedMap<K, V>

Auto Trait Implementations§

§

impl<K, V> Freeze for ReassignableCountedMap<K, V>
where K: Freeze,

§

impl<K, V> RefUnwindSafe for ReassignableCountedMap<K, V>

§

impl<K, V> Send for ReassignableCountedMap<K, V>
where K: Send, V: Send,

§

impl<K, V> Sync for ReassignableCountedMap<K, V>
where K: Sync, V: Sync,

§

impl<K, V> Unpin for ReassignableCountedMap<K, V>
where K: Unpin, V: Unpin,

§

impl<K, V> UnwindSafe for ReassignableCountedMap<K, V>
where K: UnwindSafe, V: UnwindSafe,

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> 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,

§

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>,

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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.