referrerpolicy=no-referrer-when-downgrade
bp_runtime

Trait StorageMapKeyProvider

Source
pub trait StorageMapKeyProvider {
    type Hasher: StorageHasher;
    type Key: FullCodec + Send + Sync;
    type Value: 'static + FullCodec;

    const MAP_NAME: &'static str;

    // Provided method
    fn final_key(pallet_prefix: &str, key: &Self::Key) -> StorageKey { ... }
}
Expand description

Can be use to access the runtime storage key of a StorageMap.

Required Associated Constants§

Source

const MAP_NAME: &'static str

The name of the variable that holds the StorageMap.

Required Associated Types§

Source

type Hasher: StorageHasher

The same as StorageMap::Hasher1.

Source

type Key: FullCodec + Send + Sync

The same as StorageMap::Key1.

Source

type Value: 'static + FullCodec

The same as StorageMap::Value.

Provided Methods§

Source

fn final_key(pallet_prefix: &str, key: &Self::Key) -> StorageKey

This is a copy of the frame_support::storage::generator::StorageMap::storage_map_final_key.

We’re using it because to call storage_map_final_key directly, we need access to the runtime and pallet instance, which (sometimes) is impossible.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

impl StorageMapKeyProvider for ParasInfoKeyProvider

impl StorageMapKeyProvider for AccountInfoStorageMapKeyProvider