Trait bevy::utils::PreHashMapExt

pub trait PreHashMapExt<K, V> {
    // Required method
    fn get_or_insert_with<F>(
        &mut self,
        key: &Hashed<K, FixedState>,
        func: F
    ) -> &mut V
       where F: FnOnce() -> V;
}
Expand description

Extension methods intended to add functionality to PreHashMap.

Required Methods§

fn get_or_insert_with<F>( &mut self, key: &Hashed<K, FixedState>, func: F ) -> &mut Vwhere F: FnOnce() -> V,

Tries to get or insert the value for the given key using the pre-computed hash first. If the PreHashMap does not already contain the key, it will clone it and insert the value returned by func.

Implementors§

§

impl<K, V> PreHashMapExt<K, V> for HashMap<Hashed<K, FixedState>, V, PassHash, Global>where K: Hash + Eq + PartialEq<K> + Clone,