Struct storage_map::StorageMap[][src]

pub struct StorageMap<L, M> { /* fields omitted */ }

StorageMap is a wrapper around HashMap that allows efficient concurrent access for the use case when only rarely the missing elements need to be created.

Methods

impl<L, K, V, S> StorageMap<L, HashMap<K, V, S>> where
    L: RawRwLock,
    K: Clone + Eq + Hash,
    S: BuildHasher
[src]

Create a new storage map with the given hasher.

Get a value associated with the key. The method assumes that more often then not the value is already there. If it's not - the closure will be called to create one. This closure is expected to always produce the same value given the same key.

Make sure the given key is in the map, as a way to warm up future run-time access to the map at the initialization stage.

Trait Implementations

impl<L: Send, M> Send for StorageMap<L, M>
[src]

impl<L: Sync, M> Sync for StorageMap<L, M>
[src]

impl<L: RawRwLock, M: Default> Default for StorageMap<L, M>
[src]

Returns the "default value" for a type. Read more

impl<L, M: Debug> Debug for StorageMap<L, M>
[src]

Formats the value using the given formatter. Read more