collect_stable_map_from

Function collect_stable_map_from 

Source
pub fn collect_stable_map_from<K, V, M>(
    map: &BTreeMap<K, V, M>,
) -> HashMap<K, V>
where K: Storable + Clone + Eq + Ord + Hash, V: Storable + Clone, M: Memory,
Expand description

Collects entries from a BTreeMap into a HashMap<K, V>.

This is a convenience wrapper over collect_stable_map that calls .iter() for you.

§Type Parameters

  • K: Key type (must be Storable, Clone, Ord, Eq, Hash)
  • V: Value type (must be Storable and Clone)
  • M: Stable memory backend

§Example

let map = collect_stable_map_from(&my_stable_map);