Trait GetStorage

Source
pub trait GetStorage {
    type Hash;

Show 15 methods // Required methods fn get_storage<'life0, 'async_trait, V>( &'life0 self, pallet: &'static str, storage_item: &'static str, at_block: Option<Self::Hash>, ) -> Pin<Box<dyn Future<Output = Result<Option<V>>> + 'async_trait>> where V: 'async_trait + Decode, Self: 'async_trait, 'life0: 'async_trait; fn get_storage_map<'life0, 'async_trait, K, V>( &'life0 self, pallet: &'static str, storage_item: &'static str, map_key: K, at_block: Option<Self::Hash>, ) -> Pin<Box<dyn Future<Output = Result<Option<V>>> + 'async_trait>> where K: 'async_trait + Encode, V: 'async_trait + Decode, Self: 'async_trait, 'life0: 'async_trait; fn get_storage_map_key_prefix<'life0, 'async_trait>( &'life0 self, pallet: &'static str, storage_item: &'static str, ) -> Pin<Box<dyn Future<Output = Result<StorageKey>> + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_storage_double_map_key_prefix<'life0, 'async_trait, K>( &'life0 self, storage_prefix: &'static str, storage_key_name: &'static str, first: K, ) -> Pin<Box<dyn Future<Output = Result<StorageKey>> + 'async_trait>> where K: 'async_trait + Encode, Self: 'async_trait, 'life0: 'async_trait; fn get_storage_double_map<'life0, 'async_trait, K, Q, V>( &'life0 self, pallet: &'static str, storage_item: &'static str, first_double_map_key: K, second_double_map_key: Q, at_block: Option<Self::Hash>, ) -> Pin<Box<dyn Future<Output = Result<Option<V>>> + 'async_trait>> where K: 'async_trait + Encode, Q: 'async_trait + Encode, V: 'async_trait + Decode, Self: 'async_trait, 'life0: 'async_trait; fn get_storage_by_key<'life0, 'async_trait, V>( &'life0 self, storage_key: StorageKey, at_block: Option<Self::Hash>, ) -> Pin<Box<dyn Future<Output = Result<Option<V>>> + 'async_trait>> where V: 'async_trait + Decode, Self: 'async_trait, 'life0: 'async_trait; fn get_storage_keys_paged_limited<'life0, 'async_trait>( &'life0 self, prefix: Option<StorageKey>, count: u32, start_key: Option<StorageKey>, at_block: Option<Self::Hash>, ) -> Pin<Box<dyn Future<Output = Result<Vec<StorageKey>>> + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_storage_keys_paged<'life0, 'async_trait>( &'life0 self, prefix: Option<StorageKey>, count: u32, start_key: Option<StorageKey>, at_block: Option<Self::Hash>, ) -> Pin<Box<dyn Future<Output = Result<Vec<StorageKey>>> + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_opaque_storage_by_key<'life0, 'async_trait>( &'life0 self, storage_key: StorageKey, at_block: Option<Self::Hash>, ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>>> + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_storage_value_proof<'life0, 'async_trait>( &'life0 self, pallet: &'static str, storage_item: &'static str, at_block: Option<Self::Hash>, ) -> Pin<Box<dyn Future<Output = Result<Option<ReadProof<Self::Hash>>>> + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_storage_map_proof<'life0, 'async_trait, K>( &'life0 self, pallet: &'static str, storage_item: &'static str, map_key: K, at_block: Option<Self::Hash>, ) -> Pin<Box<dyn Future<Output = Result<Option<ReadProof<Self::Hash>>>> + 'async_trait>> where K: 'async_trait + Encode, Self: 'async_trait, 'life0: 'async_trait; fn get_storage_double_map_proof<'life0, 'async_trait, K, Q>( &'life0 self, pallet: &'static str, storage_item: &'static str, first_double_map_key: K, second_double_map_key: Q, at_block: Option<Self::Hash>, ) -> Pin<Box<dyn Future<Output = Result<Option<ReadProof<Self::Hash>>>> + 'async_trait>> where K: 'async_trait + Encode, Q: 'async_trait + Encode, Self: 'async_trait, 'life0: 'async_trait; fn get_storage_proof_by_keys<'life0, 'async_trait>( &'life0 self, keys: Vec<StorageKey>, at_block: Option<Self::Hash>, ) -> Pin<Box<dyn Future<Output = Result<Option<ReadProof<Self::Hash>>>> + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_keys<'life0, 'async_trait>( &'life0 self, key: StorageKey, at_block: Option<Self::Hash>, ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<String>>>> + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_constant<'life0, 'async_trait, C>( &'life0 self, pallet: &'static str, constant: &'static str, ) -> Pin<Box<dyn Future<Output = Result<C>> + 'async_trait>> where C: 'async_trait + Decode, Self: 'async_trait, 'life0: 'async_trait;
}
Expand description

Generic interface to substrate storage.

Required Associated Types§

Required Methods§

Source

fn get_storage<'life0, 'async_trait, V>( &'life0 self, pallet: &'static str, storage_item: &'static str, at_block: Option<Self::Hash>, ) -> Pin<Box<dyn Future<Output = Result<Option<V>>> + 'async_trait>>
where V: 'async_trait + Decode, Self: 'async_trait, 'life0: 'async_trait,

Retrieve the storage value.

at_block: the state is queried at this block, set to None to get the state from the latest known block.

Source

fn get_storage_map<'life0, 'async_trait, K, V>( &'life0 self, pallet: &'static str, storage_item: &'static str, map_key: K, at_block: Option<Self::Hash>, ) -> Pin<Box<dyn Future<Output = Result<Option<V>>> + 'async_trait>>
where K: 'async_trait + Encode, V: 'async_trait + Decode, Self: 'async_trait, 'life0: 'async_trait,

Retrieve the storage value from a map for the given map_key.

at_block: the state is queried at this block, set to None to get the state from the latest known block.

Source

fn get_storage_map_key_prefix<'life0, 'async_trait>( &'life0 self, pallet: &'static str, storage_item: &'static str, ) -> Pin<Box<dyn Future<Output = Result<StorageKey>> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Retrieve the key prefix for a storage map. This is the prefix needed for get_storage_keys_paged().

Source

fn get_storage_double_map_key_prefix<'life0, 'async_trait, K>( &'life0 self, storage_prefix: &'static str, storage_key_name: &'static str, first: K, ) -> Pin<Box<dyn Future<Output = Result<StorageKey>> + 'async_trait>>
where K: 'async_trait + Encode, Self: 'async_trait, 'life0: 'async_trait,

Source

fn get_storage_double_map<'life0, 'async_trait, K, Q, V>( &'life0 self, pallet: &'static str, storage_item: &'static str, first_double_map_key: K, second_double_map_key: Q, at_block: Option<Self::Hash>, ) -> Pin<Box<dyn Future<Output = Result<Option<V>>> + 'async_trait>>
where K: 'async_trait + Encode, Q: 'async_trait + Encode, V: 'async_trait + Decode, Self: 'async_trait, 'life0: 'async_trait,

Retrieve the storage value from a double map for the given keys: first_double_map_key and second_double_map_key.

at_block: the state is queried at this block, set to None to get the state from the latest known block.

Source

fn get_storage_by_key<'life0, 'async_trait, V>( &'life0 self, storage_key: StorageKey, at_block: Option<Self::Hash>, ) -> Pin<Box<dyn Future<Output = Result<Option<V>>> + 'async_trait>>
where V: 'async_trait + Decode, Self: 'async_trait, 'life0: 'async_trait,

Retrieve the storage value from the given storage_key.

at_block: the state is queried at this block, set to None to get the state from the latest known block.

Source

fn get_storage_keys_paged_limited<'life0, 'async_trait>( &'life0 self, prefix: Option<StorageKey>, count: u32, start_key: Option<StorageKey>, at_block: Option<Self::Hash>, ) -> Pin<Box<dyn Future<Output = Result<Vec<StorageKey>>> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Retrieve the keys with prefix with pagination support. Call the RPC substrate storage_keys_paged, which limits the number of returned keys.

Up to count keys will be returned. If count is too big, an error will be returned If start_key is passed, return next keys in storage in lexicographic order.

at_block: the state is queried at this block, set to None to get the state from the latest known block.

Source

fn get_storage_keys_paged<'life0, 'async_trait>( &'life0 self, prefix: Option<StorageKey>, count: u32, start_key: Option<StorageKey>, at_block: Option<Self::Hash>, ) -> Pin<Box<dyn Future<Output = Result<Vec<StorageKey>>> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Retrieve up to count keys. Support prefix and pagination support. The number of keys returned is not limited. For big numbers, the rpc calls will be made several times. Up to count keys will be returned. If start_key is passed, return next keys in storage in lexicographic order.

at_block: the state is queried at this block, set to None to get the state from the latest known block.

Source

fn get_opaque_storage_by_key<'life0, 'async_trait>( &'life0 self, storage_key: StorageKey, at_block: Option<Self::Hash>, ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>>> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Retrieve the raw storage for the given storage_key.

at_block: the state is queried at this block, set to None to get the state from the latest known block.

Source

fn get_storage_value_proof<'life0, 'async_trait>( &'life0 self, pallet: &'static str, storage_item: &'static str, at_block: Option<Self::Hash>, ) -> Pin<Box<dyn Future<Output = Result<Option<ReadProof<Self::Hash>>>> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Retrieve the storage proof of the corresponding storage value.

at_block: the state is queried at this block, set to None to get the state from the latest known block.

Source

fn get_storage_map_proof<'life0, 'async_trait, K>( &'life0 self, pallet: &'static str, storage_item: &'static str, map_key: K, at_block: Option<Self::Hash>, ) -> Pin<Box<dyn Future<Output = Result<Option<ReadProof<Self::Hash>>>> + 'async_trait>>
where K: 'async_trait + Encode, Self: 'async_trait, 'life0: 'async_trait,

Retrieve the storage proof of the corresponding storage map value.

at_block: the state is queried at this block, set to None to get the state from the latest known block.

Source

fn get_storage_double_map_proof<'life0, 'async_trait, K, Q>( &'life0 self, pallet: &'static str, storage_item: &'static str, first_double_map_key: K, second_double_map_key: Q, at_block: Option<Self::Hash>, ) -> Pin<Box<dyn Future<Output = Result<Option<ReadProof<Self::Hash>>>> + 'async_trait>>
where K: 'async_trait + Encode, Q: 'async_trait + Encode, Self: 'async_trait, 'life0: 'async_trait,

Retrieve the storage proof of the corresponding storage double map value.

at_block: the state is queried at this block, set to None to get the state from the latest known block.

Source

fn get_storage_proof_by_keys<'life0, 'async_trait>( &'life0 self, keys: Vec<StorageKey>, at_block: Option<Self::Hash>, ) -> Pin<Box<dyn Future<Output = Result<Option<ReadProof<Self::Hash>>>> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Retrieve the proof of the corresponding storage entries.

at_block: the state is queried at this block, set to None to get the state from the latest known block.

Source

fn get_keys<'life0, 'async_trait>( &'life0 self, key: StorageKey, at_block: Option<Self::Hash>, ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<String>>>> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn get_constant<'life0, 'async_trait, C>( &'life0 self, pallet: &'static str, constant: &'static str, ) -> Pin<Box<dyn Future<Output = Result<C>> + 'async_trait>>
where C: 'async_trait + Decode, Self: 'async_trait, 'life0: 'async_trait,

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.

Implementors§

Source§

impl<T, Client> GetStorage for Api<T, Client>
where T: Config, Client: Request,

Source§

type Hash = <T as Config>::Hash