pub trait StorageProvider<Block: BlockT, B: Backend<Block>> {
    // Required methods
    fn storage(
        &self,
        hash: Block::Hash,
        key: &StorageKey
    ) -> Result<Option<StorageData>>;
    fn storage_hash(
        &self,
        hash: Block::Hash,
        key: &StorageKey
    ) -> Result<Option<Block::Hash>>;
    fn storage_keys(
        &self,
        hash: Block::Hash,
        prefix: Option<&StorageKey>,
        start_key: Option<&StorageKey>
    ) -> Result<KeysIter<B::State, Block>>;
    fn storage_pairs(
        &self,
        hash: <Block as BlockT>::Hash,
        prefix: Option<&StorageKey>,
        start_key: Option<&StorageKey>
    ) -> Result<PairsIter<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,
        prefix: Option<&StorageKey>,
        start_key: Option<&StorageKey>
    ) -> Result<KeysIter<B::State, Block>>;
    fn child_storage_hash(
        &self,
        hash: Block::Hash,
        child_info: &ChildInfo,
        key: &StorageKey
    ) -> Result<Option<Block::Hash>>;
}
Expand description

Provides access to storage primitives

Required Methods§

source

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.

source

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.

source

fn storage_keys( &self, hash: Block::Hash, prefix: Option<&StorageKey>, start_key: Option<&StorageKey> ) -> Result<KeysIter<B::State, Block>>

Given a block’s Hash and a key prefix, returns a KeysIter iterates matching storage keys in that block.

source

fn storage_pairs( &self, hash: <Block as BlockT>::Hash, prefix: Option<&StorageKey>, start_key: Option<&StorageKey> ) -> Result<PairsIter<B::State, Block>>

Given a block’s Hash and a key prefix, returns an iterator over the storage keys and values in that block.

source

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.

source

fn child_storage_keys( &self, hash: Block::Hash, child_info: ChildInfo, prefix: Option<&StorageKey>, start_key: Option<&StorageKey> ) -> Result<KeysIter<B::State, Block>>

Given a block’s Hash and a key prefix and a child storage key, returns a KeysIter that iterates matching storage keys in that block.

source

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.

Implementors§