Skip to main content

TypeIdHashMap

Type Alias TypeIdHashMap 

Source
pub type TypeIdHashMap<V> = HashMap<TypeId, V, NoOpHash>;
Expand description

A specialized hash map type with a key of TypeId.

Aliased Type§

pub struct TypeIdHashMap<V>(/* private fields */);

Trait Implementations§

Source§

impl<V> TypeIdHashMapExt<V> for TypeIdHashMap<V>

Source§

fn insert_type<T: ?Sized + 'static>(&mut self, v: V) -> Option<V>

Inserts a value for the type T. Read more
Source§

fn get_type<T: ?Sized + 'static>(&self) -> Option<&V>

Returns a reference to the value for type T, if one exists.
Source§

fn get_type_mut<T: ?Sized + 'static>(&mut self) -> Option<&mut V>

Returns a mutable reference to the value for type T, if one exists.
Source§

fn remove_type<T: ?Sized + 'static>(&mut self) -> Option<V>

Removes type T from the map, returning the value for this key if it was previously present.
Source§

fn entry_type<T: ?Sized + 'static>( &mut self, ) -> TypeIdHashMapEntry<'_, TypeId, V, NoOpHash>

Gets the type T’s entry in the map for in-place manipulation.