Skip to main content

DenseHashMap

Struct DenseHashMap 

Source
pub struct DenseHashMap<K, V, H = DenseHashDefault<K>, E = DenseEqDefault<K>> { /* private fields */ }

Implementations§

Source§

impl<K, V, H, E> DenseHashMap<K, V, H, E>
where K: Clone, V: DenseDefault, H: DenseHasher<K> + Default, E: DenseEq<K> + Default + Clone,

Source

pub fn try_insert_mut(&mut self, key: K, value: V) -> (&mut V, bool)

Source§

impl<K, V, H, E> DenseHashMap<K, V, H, E>
where K: Clone, V: DenseDefault, H: DenseHasher<K> + Default, E: DenseEq<K> + Default + Clone,

Source

pub fn new(empty_key: K) -> Self

DenseHashMap(empty_key, buckets = 0). Reference: DenseHash.h:570-573.

Source

pub fn get_or_insert(&mut self, key: K) -> &mut V

operator[] — inserts a default value when absent and returns a mutable reference to the slot’s value. Reference: DenseHash.h:580-585.

Source

pub fn find(&self, key: &K) -> Option<&V>

const Value* find(const Key&) const. Reference: DenseHash.h:588-593.

Source

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

std-style alias for generated Rust that spelled C++ find as get.

Source

pub fn find_mut(&mut self, key: &K) -> Option<&mut V>

Value* find(const Key&). Reference: DenseHash.h:596-601.

Source

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

std-style alias for generated Rust that spelled C++ find as get_mut.

Source

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

contains. Reference: DenseHash.h:603-606. std-style alias for contains — translations use HashMap idioms.

Source

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

Source

pub fn try_insert(&mut self, key: K, value: V) -> (&mut V, bool)

try_insert — returns (value_ref, fresh), where fresh is true only when the key was newly inserted; an existing slot keeps its value. Reference: DenseHash.h:608-638.

Source

pub fn size(&self) -> usize

size. Reference: DenseHash.h:640-643.

Source

pub fn empty(&self) -> bool

empty. Reference: DenseHash.h:645-648.

Source

pub fn is_empty(&self) -> bool

std-style alias for translated code that calls C++ empty() as is_empty().

Source

pub fn clear(&mut self)

clear. Reference: DenseHash.h:575-578.

Source

pub fn iter(&self) -> impl Iterator<Item = (&K, &V)>

begin()/end() const iteration, yielding (&Key, &Value).

Source

pub fn iter_mut(&mut self) -> impl Iterator<Item = (&K, &mut V)>

begin()/end() mutable iteration, yielding (&Key, &mut Value).

Trait Implementations§

Source§

impl<K: Clone, V: Clone, H: Clone, E: Clone> Clone for DenseHashMap<K, V, H, E>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<K: Debug, V: Debug, H, E> Debug for DenseHashMap<K, V, H, E>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<K, V, H, E> Freeze for DenseHashMap<K, V, H, E>
where K: Freeze, H: Freeze, E: Freeze,

§

impl<K, V, H, E> RefUnwindSafe for DenseHashMap<K, V, H, E>

§

impl<K, V, H, E> Send for DenseHashMap<K, V, H, E>
where K: Send, H: Send, E: Send, V: Send,

§

impl<K, V, H, E> Sync for DenseHashMap<K, V, H, E>
where K: Sync, H: Sync, E: Sync, V: Sync,

§

impl<K, V, H, E> Unpin for DenseHashMap<K, V, H, E>
where K: Unpin, H: Unpin, E: Unpin, V: Unpin,

§

impl<K, V, H, E> UnsafeUnpin for DenseHashMap<K, V, H, E>

§

impl<K, V, H, E> UnwindSafe for DenseHashMap<K, V, H, E>

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

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.