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§
Required Associated Types§
Provided Methods§
Sourcefn final_key(pallet_prefix: &str, key: &Self::Key) -> StorageKey
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.