Trait sc_rpc_api::child_state::ChildStateApi
source · [−]pub trait ChildStateApi<Hash>: Sized + Send + Sync + 'static {
type Metadata: Metadata;
fn storage_keys(
&self,
child_storage_key: PrefixedStorageKey,
prefix: StorageKey,
hash: Option<Hash>
) -> FutureResult<Vec<StorageKey>>;
fn storage(
&self,
child_storage_key: PrefixedStorageKey,
key: StorageKey,
hash: Option<Hash>
) -> FutureResult<Option<StorageData>>;
fn storage_hash(
&self,
child_storage_key: PrefixedStorageKey,
key: StorageKey,
hash: Option<Hash>
) -> FutureResult<Option<Hash>>;
fn storage_size(
&self,
child_storage_key: PrefixedStorageKey,
key: StorageKey,
hash: Option<Hash>
) -> FutureResult<Option<u64>>;
fn to_delegate(self) -> IoDelegate<Self, Self::Metadata>
where
Hash: Send + Sync + 'static + Serialize + DeserializeOwned,
{ ... }
}
Expand description
Substrate child state API
Note that all PrefixedStorageKey
are desierialized
from json and not guaranted valid.
Associated Types
Required methods
fn storage_keys(
&self,
child_storage_key: PrefixedStorageKey,
prefix: StorageKey,
hash: Option<Hash>
) -> FutureResult<Vec<StorageKey>>
fn storage_keys(
&self,
child_storage_key: PrefixedStorageKey,
prefix: StorageKey,
hash: Option<Hash>
) -> FutureResult<Vec<StorageKey>>
Returns the keys with prefix from a child storage, leave empty to get all the keys
fn storage(
&self,
child_storage_key: PrefixedStorageKey,
key: StorageKey,
hash: Option<Hash>
) -> FutureResult<Option<StorageData>>
fn storage(
&self,
child_storage_key: PrefixedStorageKey,
key: StorageKey,
hash: Option<Hash>
) -> FutureResult<Option<StorageData>>
Returns a child storage entry at a specific block’s state.
fn storage_hash(
&self,
child_storage_key: PrefixedStorageKey,
key: StorageKey,
hash: Option<Hash>
) -> FutureResult<Option<Hash>>
fn storage_hash(
&self,
child_storage_key: PrefixedStorageKey,
key: StorageKey,
hash: Option<Hash>
) -> FutureResult<Option<Hash>>
Returns the hash of a child storage entry at a block’s state.
fn storage_size(
&self,
child_storage_key: PrefixedStorageKey,
key: StorageKey,
hash: Option<Hash>
) -> FutureResult<Option<u64>>
fn storage_size(
&self,
child_storage_key: PrefixedStorageKey,
key: StorageKey,
hash: Option<Hash>
) -> FutureResult<Option<u64>>
Returns the size of a child storage entry at a block’s state.
Provided methods
fn to_delegate(self) -> IoDelegate<Self, Self::Metadata> where
Hash: Send + Sync + 'static + Serialize + DeserializeOwned,
fn to_delegate(self) -> IoDelegate<Self, Self::Metadata> where
Hash: Send + Sync + 'static + Serialize + DeserializeOwned,
Create an IoDelegate
, wiring rpc calls to the trait methods.