pub trait StorageMap {
type KEY: Decode + Encode;
type VALUE: Decode;
const PALLET_NAME: &'static str;
const STORAGE_NAME: &'static str;
const KEY_HASHER: StorageHasher;
// Provided methods
fn encode_partial_key() -> [u8; 32] { ... }
fn hex_encode_partial_key() -> String { ... }
fn encode_storage_key(key: &Self::KEY) -> Vec<u8> ⓘ { ... }
fn hex_encode_storage_key(key: &Self::KEY) -> String { ... }
fn decode_storage_key(value: &mut &[u8]) -> Result<Self::KEY, Error> { ... }
fn decode_storage_value(value: &mut &[u8]) -> Result<Self::VALUE, Error> { ... }
fn fetch(
client: &RpcClient,
key: &Self::KEY,
at: Option<H256>,
) -> impl Future<Output = Result<Option<Self::VALUE>, Error>> { ... }
fn iter(client: RpcClient, block_hash: H256) -> StorageMapIterator<Self>
where Self: Sized { ... }
}
Required Associated Constants§
const PALLET_NAME: &'static str
const STORAGE_NAME: &'static str
const KEY_HASHER: StorageHasher
Required Associated Types§
Provided Methods§
fn encode_partial_key() -> [u8; 32]
fn hex_encode_partial_key() -> String
fn encode_storage_key(key: &Self::KEY) -> Vec<u8> ⓘ
fn hex_encode_storage_key(key: &Self::KEY) -> String
fn decode_storage_key(value: &mut &[u8]) -> Result<Self::KEY, Error>
fn decode_storage_value(value: &mut &[u8]) -> Result<Self::VALUE, Error>
fn fetch( client: &RpcClient, key: &Self::KEY, at: Option<H256>, ) -> impl Future<Output = Result<Option<Self::VALUE>, Error>>
fn iter(client: RpcClient, block_hash: H256) -> StorageMapIterator<Self>where
Self: Sized,
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.