pub struct HandledHashMap<T>{ /* private fields */ }Expand description
A collection of Handled instances with automatically-generated handles, supporting efficient hash-based instance-to-handle lookup.
This data structure accumulates instances of some Handled type T, while automatically
generating handles to each of the contained instances, based on their order of insertion to the
vector. It supports efficient hash-based instance-to-handle lookup.
This usually serves for generating handles to instances of simple data types, not simple enough to be AutomaticallyHandled.
§Example
struct Animal(String);
impl Handled for Animal {
type HandleCoreType = u8;
}
let mut animals = HandledHashMap::new();
let dog_handle = animals.insert(Animal(String::from("dog")));
let cat_handle = animals.insert(Animal(String::from("cat")));Implementations§
Source§impl<T> HandledHashMap<T>
impl<T> HandledHashMap<T>
Trait Implementations§
Source§impl<T> FromIterator<T> for HandledHashMap<T>
impl<T> FromIterator<T> for HandledHashMap<T>
Source§fn from_iter<U: IntoIterator<Item = T>>(iter: U) -> Self
fn from_iter<U: IntoIterator<Item = T>>(iter: U) -> Self
Creates a value from an iterator. Read more
Auto Trait Implementations§
impl<T> Freeze for HandledHashMap<T>
impl<T> RefUnwindSafe for HandledHashMap<T>
impl<T> Send for HandledHashMap<T>
impl<T> Sync for HandledHashMap<T>
impl<T> Unpin for HandledHashMap<T>
impl<T> UnwindSafe for HandledHashMap<T>
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