Trait sc_client_api::backend::StorageProvider
source · pub trait StorageProvider<Block: BlockT, B: Backend<Block>> {
// Required methods
fn storage(
&self,
hash: Block::Hash,
key: &StorageKey
) -> Result<Option<StorageData>>;
fn storage_keys(
&self,
hash: Block::Hash,
key_prefix: &StorageKey
) -> Result<Vec<StorageKey>>;
fn storage_hash(
&self,
hash: Block::Hash,
key: &StorageKey
) -> Result<Option<Block::Hash>>;
fn storage_pairs(
&self,
hash: Block::Hash,
key_prefix: &StorageKey
) -> Result<Vec<(StorageKey, StorageData)>>;
fn storage_keys_iter<'a>(
&self,
hash: Block::Hash,
prefix: Option<&'a StorageKey>,
start_key: Option<&StorageKey>
) -> Result<KeyIterator<'a, B::State, Block>>;
fn child_storage(
&self,
hash: Block::Hash,
child_info: &ChildInfo,
key: &StorageKey
) -> Result<Option<StorageData>>;
fn child_storage_keys(
&self,
hash: Block::Hash,
child_info: &ChildInfo,
key_prefix: &StorageKey
) -> Result<Vec<StorageKey>>;
fn child_storage_keys_iter<'a>(
&self,
hash: Block::Hash,
child_info: ChildInfo,
prefix: Option<&'a StorageKey>,
start_key: Option<&StorageKey>
) -> Result<KeyIterator<'a, B::State, Block>>;
fn child_storage_hash(
&self,
hash: Block::Hash,
child_info: &ChildInfo,
key: &StorageKey
) -> Result<Option<Block::Hash>>;
}
Expand description
Provides acess to storage primitives
Required Methods§
sourcefn storage(
&self,
hash: Block::Hash,
key: &StorageKey
) -> Result<Option<StorageData>>
fn storage( &self, hash: Block::Hash, key: &StorageKey ) -> Result<Option<StorageData>>
Given a block’s Hash
and a key, return the value under the key in that block.
sourcefn storage_keys(
&self,
hash: Block::Hash,
key_prefix: &StorageKey
) -> Result<Vec<StorageKey>>
fn storage_keys( &self, hash: Block::Hash, key_prefix: &StorageKey ) -> Result<Vec<StorageKey>>
Given a block’s Hash
and a key prefix, return the matching storage keys in that block.
sourcefn storage_hash(
&self,
hash: Block::Hash,
key: &StorageKey
) -> Result<Option<Block::Hash>>
fn storage_hash( &self, hash: Block::Hash, key: &StorageKey ) -> Result<Option<Block::Hash>>
Given a block’s Hash
and a key, return the value under the hash in that block.
sourcefn storage_pairs(
&self,
hash: Block::Hash,
key_prefix: &StorageKey
) -> Result<Vec<(StorageKey, StorageData)>>
fn storage_pairs( &self, hash: Block::Hash, key_prefix: &StorageKey ) -> Result<Vec<(StorageKey, StorageData)>>
Given a block’s Hash
and a key prefix, return the matching child storage keys and values
in that block.
sourcefn storage_keys_iter<'a>(
&self,
hash: Block::Hash,
prefix: Option<&'a StorageKey>,
start_key: Option<&StorageKey>
) -> Result<KeyIterator<'a, B::State, Block>>
fn storage_keys_iter<'a>( &self, hash: Block::Hash, prefix: Option<&'a StorageKey>, start_key: Option<&StorageKey> ) -> Result<KeyIterator<'a, B::State, Block>>
Given a block’s Hash
and a key prefix, return a KeyIterator
iterates matching storage
keys in that block.
sourcefn child_storage(
&self,
hash: Block::Hash,
child_info: &ChildInfo,
key: &StorageKey
) -> Result<Option<StorageData>>
fn child_storage( &self, hash: Block::Hash, child_info: &ChildInfo, key: &StorageKey ) -> Result<Option<StorageData>>
Given a block’s Hash
, a key and a child storage key, return the value under the key in
that block.
sourcefn child_storage_keys(
&self,
hash: Block::Hash,
child_info: &ChildInfo,
key_prefix: &StorageKey
) -> Result<Vec<StorageKey>>
fn child_storage_keys( &self, hash: Block::Hash, child_info: &ChildInfo, key_prefix: &StorageKey ) -> Result<Vec<StorageKey>>
Given a block’s Hash
, a key prefix, and a child storage key, return the matching child
storage keys.
sourcefn child_storage_keys_iter<'a>(
&self,
hash: Block::Hash,
child_info: ChildInfo,
prefix: Option<&'a StorageKey>,
start_key: Option<&StorageKey>
) -> Result<KeyIterator<'a, B::State, Block>>
fn child_storage_keys_iter<'a>( &self, hash: Block::Hash, child_info: ChildInfo, prefix: Option<&'a StorageKey>, start_key: Option<&StorageKey> ) -> Result<KeyIterator<'a, B::State, Block>>
Given a block’s Hash
and a key prefix
and a child storage key,
return a KeyIterator
that iterates matching storage keys in that block.
sourcefn child_storage_hash(
&self,
hash: Block::Hash,
child_info: &ChildInfo,
key: &StorageKey
) -> Result<Option<Block::Hash>>
fn child_storage_hash( &self, hash: Block::Hash, child_info: &ChildInfo, key: &StorageKey ) -> Result<Option<Block::Hash>>
Given a block’s Hash
, a key and a child storage key, return the hash under the key in that
block.