[−][src]Trait frame_support::storage::generator::StorageMap
Generator for StorageMap
used by decl_storage
.
By default each key value is stored at:
Twox128(module_prefix) ++ Twox128(storage_prefix) ++ Hasher(encode(key))
Warning
If the keys are not trusted (e.g. can be set by a user), a cryptographic hasher
such as
blake2_256
must be used. Otherwise, other values in storage can be compromised.
Associated Types
type Query
The type that get/take returns.
type Hasher: StorageHasher
Hasher. Used for generating final key.
Required methods
fn module_prefix() -> &'static [u8]
Module prefix. Used for generating final key.
fn storage_prefix() -> &'static [u8]
Storage prefix. Used for generating final key.
fn from_optional_value_to_query(v: Option<V>) -> Self::Query
Convert an optional value retrieved from storage to the type queried.
fn from_query_to_optional_value(v: Self::Query) -> Option<V>
Convert a query to an optional value into storage.
Provided methods
fn storage_map_final_key<KeyArg>(key: KeyArg) -> Vec<u8> where
KeyArg: EncodeLike<K>,
KeyArg: EncodeLike<K>,
Generate the full key used in top storage.