In the tutorial of learning substrate, a storage map for stored items is defined as follows, in which the symbol
=> appears, but this specification is not in the standard syntax of rust. How to understand it?
MyMap get(my_map): map u8 => Vec<u8>;
Substrate and Polkadot Stack Exchange is a question and answer site for developers building blockchains with the Substrate SDK. It only takes a minute to sign up.Sign up to join this community
#[pallet::storage] #[pallet::getter(fn some_map)] pub(super) type SomeMap<T: Config> = StorageMap<_, Blake2_128Concat, SomeKey, SomeValue, ValueQuery>;
sets up a StorageMap with name
SomeKey => SomeValue with getter function
some_map using the
ValueQuery states that the resulting value lookup is not wrapped into an Option, which would be the case if you were using
OptionQuery (default implementation of the QueryKind generic).