pub trait StorageDoubleMap {
type KEY1: Decode + Encode;
type KEY2: Decode + Encode;
type VALUE: Decode;
const PALLET_NAME: &'static str;
const STORAGE_NAME: &'static str;
const KEY1_HASHER: StorageHasher;
const KEY2_HASHER: StorageHasher;
// Provided methods
fn encode_partial_key(key1: &Self::KEY1) -> Vec<u8> ⓘ { ... }
fn hex_encode_partial_key(key1: &Self::KEY1) -> String { ... }
fn encode_storage_key(key1: &Self::KEY1, key2: &Self::KEY2) -> Vec<u8> ⓘ { ... }
fn hex_encode_storage_key(key1: &Self::KEY1, key2: &Self::KEY2) -> String { ... }
fn decode_partial_key(value: &mut &[u8]) -> Result<Self::KEY1, Error> { ... }
fn decode_hex_storage_key(
value: &str,
) -> Result<(Self::KEY1, Self::KEY2), Error> { ... }
fn decode_storage_key(
value: &mut &[u8],
) -> Result<(Self::KEY1, Self::KEY2), Error> { ... }
fn decode_hex_storage_value(value: &str) -> Result<Self::VALUE, Error> { ... }
fn decode_storage_value(value: &mut &[u8]) -> Result<Self::VALUE, Error> { ... }
fn fetch(
client: &RpcClient,
key_1: &Self::KEY1,
key_2: &Self::KEY2,
at: Option<H256>,
) -> impl Future<Output = Result<Option<Self::VALUE>, Error>> { ... }
fn iter(
client: RpcClient,
key_1: &Self::KEY1,
block_hash: H256,
) -> StorageDoubleMapIterator<Self>
where Self: Sized { ... }
}
Required Associated Constants§
const PALLET_NAME: &'static str
const STORAGE_NAME: &'static str
const KEY1_HASHER: StorageHasher
const KEY2_HASHER: StorageHasher
Required Associated Types§
Provided Methods§
fn encode_partial_key(key1: &Self::KEY1) -> Vec<u8> ⓘ
fn hex_encode_partial_key(key1: &Self::KEY1) -> String
fn encode_storage_key(key1: &Self::KEY1, key2: &Self::KEY2) -> Vec<u8> ⓘ
fn hex_encode_storage_key(key1: &Self::KEY1, key2: &Self::KEY2) -> String
fn decode_partial_key(value: &mut &[u8]) -> Result<Self::KEY1, Error>
Sourcefn decode_hex_storage_key(
value: &str,
) -> Result<(Self::KEY1, Self::KEY2), Error>
fn decode_hex_storage_key( value: &str, ) -> Result<(Self::KEY1, Self::KEY2), Error>
Decodes the Hex and SCALE encoded Storage Key This is equal to Hex::decode + Self::decode_storage_key
If you need to decode bytes call decode_storage_key
Sourcefn decode_storage_key(
value: &mut &[u8],
) -> Result<(Self::KEY1, Self::KEY2), Error>
fn decode_storage_key( value: &mut &[u8], ) -> Result<(Self::KEY1, Self::KEY2), Error>
Decodes the SCALE encoded Storage Key
If you need to decode Hex string call decode_hex_storage_key
Sourcefn decode_hex_storage_value(value: &str) -> Result<Self::VALUE, Error>
fn decode_hex_storage_value(value: &str) -> Result<Self::VALUE, Error>
Decodes the Hex and SCALE encoded Storage Value This is equal to Hex::decode + Self::decode_storage_value
If you need to decode bytes call decode_storage_value
Sourcefn decode_storage_value(value: &mut &[u8]) -> Result<Self::VALUE, Error>
fn decode_storage_value(value: &mut &[u8]) -> Result<Self::VALUE, Error>
Decodes the SCALE encoded Storage Value
If you need to decode Hex string call decode_hex_storage_value
Sourcefn fetch(
client: &RpcClient,
key_1: &Self::KEY1,
key_2: &Self::KEY2,
at: Option<H256>,
) -> impl Future<Output = Result<Option<Self::VALUE>, Error>>
fn fetch( client: &RpcClient, key_1: &Self::KEY1, key_2: &Self::KEY2, at: Option<H256>, ) -> impl Future<Output = Result<Option<Self::VALUE>, Error>>
Fetches and decodes a Storage Value
Returns None if no Storage Value is present
fn iter(
client: RpcClient,
key_1: &Self::KEY1,
block_hash: H256,
) -> StorageDoubleMapIterator<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.