Trait sc_rpc::state::ChildStateBackend
source · pub trait ChildStateBackend<Block, Client>: Send + Sync + 'staticwhere
Block: BlockT + 'static,
Client: Send + Sync + 'static,{
// Required methods
fn read_child_proof(
&self,
block: Option<Block::Hash>,
storage_key: PrefixedStorageKey,
keys: Vec<StorageKey>
) -> Result<ReadProof<Block::Hash>, Error>;
fn storage_keys(
&self,
block: Option<Block::Hash>,
storage_key: PrefixedStorageKey,
prefix: StorageKey
) -> Result<Vec<StorageKey>, Error>;
fn storage_keys_paged(
&self,
block: Option<Block::Hash>,
storage_key: PrefixedStorageKey,
prefix: Option<StorageKey>,
count: u32,
start_key: Option<StorageKey>
) -> Result<Vec<StorageKey>, Error>;
fn storage(
&self,
block: Option<Block::Hash>,
storage_key: PrefixedStorageKey,
key: StorageKey
) -> Result<Option<StorageData>, Error>;
fn storage_entries(
&self,
block: Option<Block::Hash>,
storage_key: PrefixedStorageKey,
keys: Vec<StorageKey>
) -> Result<Vec<Option<StorageData>>, Error>;
fn storage_hash(
&self,
block: Option<Block::Hash>,
storage_key: PrefixedStorageKey,
key: StorageKey
) -> Result<Option<Block::Hash>, Error>;
// Provided method
fn storage_size(
&self,
block: Option<Block::Hash>,
storage_key: PrefixedStorageKey,
key: StorageKey
) -> Result<Option<u64>, Error> { ... }
}
Expand description
Child state backend API.
Required Methods§
sourcefn read_child_proof(
&self,
block: Option<Block::Hash>,
storage_key: PrefixedStorageKey,
keys: Vec<StorageKey>
) -> Result<ReadProof<Block::Hash>, Error>
fn read_child_proof( &self, block: Option<Block::Hash>, storage_key: PrefixedStorageKey, keys: Vec<StorageKey> ) -> Result<ReadProof<Block::Hash>, Error>
Returns proof of storage for a child key entries at a specific block’s state.
sourcefn storage_keys(
&self,
block: Option<Block::Hash>,
storage_key: PrefixedStorageKey,
prefix: StorageKey
) -> Result<Vec<StorageKey>, Error>
fn storage_keys( &self, block: Option<Block::Hash>, storage_key: PrefixedStorageKey, prefix: StorageKey ) -> Result<Vec<StorageKey>, Error>
Returns the keys with prefix from a child storage, leave prefix empty to get all the keys.
sourcefn storage_keys_paged(
&self,
block: Option<Block::Hash>,
storage_key: PrefixedStorageKey,
prefix: Option<StorageKey>,
count: u32,
start_key: Option<StorageKey>
) -> Result<Vec<StorageKey>, Error>
fn storage_keys_paged( &self, block: Option<Block::Hash>, storage_key: PrefixedStorageKey, prefix: Option<StorageKey>, count: u32, start_key: Option<StorageKey> ) -> Result<Vec<StorageKey>, Error>
Returns the keys with prefix from a child storage with pagination support.
sourcefn storage(
&self,
block: Option<Block::Hash>,
storage_key: PrefixedStorageKey,
key: StorageKey
) -> Result<Option<StorageData>, Error>
fn storage( &self, block: Option<Block::Hash>, storage_key: PrefixedStorageKey, key: StorageKey ) -> Result<Option<StorageData>, Error>
Returns a child storage entry at a specific block’s state.