Struct sc_service::client::Client

source ·
pub struct Client<B, E, Block, RA>where
    Block: BlockT,{ /* private fields */ }
Expand description

Substrate Client

Implementations§

source§

impl<B, E, Block, RA> Client<B, E, Block, RA>where B: Backend<Block>, E: CallExecutor<Block>, Block: BlockT, Block::Header: Clone,

source

pub fn new<G>( backend: Arc<B>, executor: E, spawn_handle: Box<dyn SpawnNamed>, genesis_block_builder: G, fork_blocks: ForkBlocks<Block>, bad_blocks: BadBlocks<Block>, prometheus_registry: Option<Registry>, telemetry: Option<TelemetryHandle>, config: ClientConfig<Block> ) -> Result<Self>where G: BuildGenesisBlock<Block, BlockImportOperation = <B as Backend<Block>>::BlockImportOperation>, B: 'static,

Creates new Substrate Client with given blockchain and code executor.

source

pub fn import_notification_sinks( &self ) -> &Mutex<Vec<TracingUnboundedSender<BlockImportNotification<Block>>>>

returns a reference to the block import notification sinks useful for test environments.

source

pub fn finality_notification_sinks( &self ) -> &Mutex<Vec<TracingUnboundedSender<FinalityNotification<Block>>>>

returns a reference to the finality notification sinks useful for test environments.

source

pub fn state_at(&self, hash: Block::Hash) -> Result<B::State>

Get a reference to the state at a given block.

source

pub fn code_at(&self, hash: Block::Hash) -> Result<Vec<u8>>

Get the code at a given block.

source

pub fn runtime_version_at(&self, hash: Block::Hash) -> Result<RuntimeVersion>

Get the RuntimeVersion at a given block.

source

pub fn revert(&self, n: NumberFor<Block>) -> Result<NumberFor<Block>>

Attempts to revert the chain by n blocks guaranteeing that no block is reverted past the last finalized block. Returns the number of blocks that were successfully reverted.

source

pub fn unsafe_revert( &mut self, n: NumberFor<Block>, blacklist: bool ) -> Result<NumberFor<Block>>

Attempts to revert the chain by n blocks disregarding finality. This method will revert any finalized blocks as requested and can potentially leave the node in an inconsistent state. Other modules in the system that persist data and that rely on finality (e.g. consensus parts) will be unaffected by the revert. Use this method with caution and making sure that no other data needs to be reverted for consistency aside from the block data. If blacklist is set to true, will also blacklist reverted blocks from finalizing again. The blacklist is reset upon client restart.

Returns the number of blocks that were successfully reverted.

source

pub fn chain_info(&self) -> BlockchainInfo<Block>

Get blockchain info.

source

pub fn block_status(&self, hash: Block::Hash) -> Result<BlockStatus>

Get block status.

source

pub fn header( &self, hash: Block::Hash ) -> Result<Option<<Block as BlockT>::Header>>

Get block header by id.

source

pub fn body( &self, hash: Block::Hash ) -> Result<Option<Vec<<Block as BlockT>::Extrinsic>>>

Get block body by id.

source

pub fn uncles( &self, target_hash: Block::Hash, max_generation: NumberFor<Block> ) -> Result<Vec<Block::Hash>>

Gets the uncles of the block with target_hash going back max_generation ancestors.

Trait Implementations§

source§

impl<B, E, Block, RA> AuxStore for &Client<B, E, Block, RA>where B: Backend<Block>, E: CallExecutor<Block>, Block: BlockT, Client<B, E, Block, RA>: ProvideRuntimeApi<Block>, <Client<B, E, Block, RA> as ProvideRuntimeApi<Block>>::Api: CoreApi<Block>,

source§

fn insert_aux<'a, 'b: 'a, 'c: 'a, I: IntoIterator<Item = &'a (&'c [u8], &'c [u8])>, D: IntoIterator<Item = &'a &'b [u8]>>( &self, insert: I, delete: D ) -> Result<()>

Insert auxiliary data into key-value store. Read more
source§

fn get_aux(&self, key: &[u8]) -> Result<Option<Vec<u8>>>

Query auxiliary data from key-value store.
source§

impl<B, E, Block, RA> AuxStore for Client<B, E, Block, RA>where B: Backend<Block>, E: CallExecutor<Block>, Block: BlockT, Self: ProvideRuntimeApi<Block>, <Self as ProvideRuntimeApi<Block>>::Api: CoreApi<Block>,

source§

fn insert_aux<'a, 'b: 'a, 'c: 'a, I: IntoIterator<Item = &'a (&'c [u8], &'c [u8])>, D: IntoIterator<Item = &'a &'b [u8]>>( &self, insert: I, delete: D ) -> Result<()>

Insert auxiliary data into key-value store.

source§

fn get_aux(&self, key: &[u8]) -> Result<Option<Vec<u8>>>

Query auxiliary data from key-value store.

source§

impl<B, E, Block, RA> BlockBackend<Block> for Client<B, E, Block, RA>where B: Backend<Block>, E: CallExecutor<Block>, Block: BlockT,

source§

fn block_body( &self, hash: Block::Hash ) -> Result<Option<Vec<<Block as BlockT>::Extrinsic>>>

Get block body by ID. Returns None if the body is not stored.
source§

fn block(&self, hash: Block::Hash) -> Result<Option<SignedBlock<Block>>>

Get full block by hash.
source§

fn block_status(&self, hash: Block::Hash) -> Result<BlockStatus>

Get block status by block hash.
source§

fn justifications(&self, hash: Block::Hash) -> Result<Option<Justifications>>

Get block justifications for the block with the given hash.
source§

fn block_hash(&self, number: NumberFor<Block>) -> Result<Option<Block::Hash>>

Get block hash by number.
source§

fn indexed_transaction(&self, hash: Block::Hash) -> Result<Option<Vec<u8>>>

Get single indexed transaction by content hash. Read more
source§

fn has_indexed_transaction(&self, hash: Block::Hash) -> Result<bool>

Check if transaction index exists.
source§

fn block_indexed_body(&self, hash: Block::Hash) -> Result<Option<Vec<Vec<u8>>>>

Get all indexed transactions for a block, including renewed transactions. Read more
source§

fn requires_full_sync(&self) -> bool

Tells whether the current client configuration requires full-sync mode.
source§

impl<B, E, Block, RA> BlockBuilderProvider<B, Block, Client<B, E, Block, RA>> for Client<B, E, Block, RA>where B: Backend<Block> + Send + Sync + 'static, E: CallExecutor<Block> + Send + Sync + 'static, Block: BlockT, Self: ChainHeaderBackend<Block> + ProvideRuntimeApi<Block>, <Self as ProvideRuntimeApi<Block>>::Api: ApiExt<Block> + BlockBuilderApi<Block>,

source§

fn new_block_at<R: Into<RecordProof>>( &self, parent: Block::Hash, inherent_digests: Digest, record_proof: R ) -> Result<BlockBuilder<'_, Block, Self, B>>

Create a new block, built on top of parent. Read more
source§

fn new_block( &self, inherent_digests: Digest ) -> Result<BlockBuilder<'_, Block, Self, B>>

Create a new block, built on the head of the chain.
source§

impl<B, E, Block, RA> BlockIdTo<Block> for Client<B, E, Block, RA>where B: Backend<Block>, E: CallExecutor<Block> + Send + Sync, Block: BlockT, RA: Send + Sync,

§

type Error = Error

The error type that will be returned by the functions.
source§

fn to_hash(&self, block_id: &BlockId<Block>) -> Result<Option<Block::Hash>>

Convert the given block_id to the corresponding block hash.
source§

fn to_number( &self, block_id: &BlockId<Block> ) -> Result<Option<NumberFor<Block>>>

Convert the given block_id to the corresponding block number.
source§

impl<B, E, Block, RA> BlockImport<Block> for &Client<B, E, Block, RA>where B: Backend<Block>, E: CallExecutor<Block> + Send + Sync, Block: BlockT, Client<B, E, Block, RA>: ProvideRuntimeApi<Block>, <Client<B, E, Block, RA> as ProvideRuntimeApi<Block>>::Api: CoreApi<Block> + ApiExt<Block>, RA: Sync + Send,

NOTE: only use this implementation when you are sure there are NO consensus-level BlockImport objects. Otherwise, importing blocks directly into the client would be bypassing important verification work.

source§

fn import_block<'life0, 'async_trait>( &'life0 mut self, import_block: BlockImportParams<Block> ) -> Pin<Box<dyn Future<Output = Result<ImportResult, Self::Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Import a checked and validated block. If a justification is provided in BlockImportParams then finalized must be true.

NOTE: only use this implementation when there are NO consensus-level BlockImport objects. Otherwise, importing blocks directly into the client would be bypassing important verification work.

If you are not sure that there are no BlockImport objects provided by the consensus algorithm, don’t use this function.

source§

fn check_block<'life0, 'async_trait>( &'life0 mut self, block: BlockCheckParams<Block> ) -> Pin<Box<dyn Future<Output = Result<ImportResult, Self::Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Check block preconditions.

§

type Error = Error

The error type.
source§

impl<B, E, Block, RA> BlockImport<Block> for Client<B, E, Block, RA>where B: Backend<Block>, E: CallExecutor<Block> + Send + Sync, Block: BlockT, Self: ProvideRuntimeApi<Block>, <Self as ProvideRuntimeApi<Block>>::Api: CoreApi<Block> + ApiExt<Block>, RA: Sync + Send,

§

type Error = Error

The error type.
source§

fn import_block<'life0, 'async_trait>( &'life0 mut self, import_block: BlockImportParams<Block> ) -> Pin<Box<dyn Future<Output = Result<ImportResult, Self::Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Import a block.
source§

fn check_block<'life0, 'async_trait>( &'life0 mut self, block: BlockCheckParams<Block> ) -> Pin<Box<dyn Future<Output = Result<ImportResult, Self::Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Check block preconditions.
source§

impl<B, E, Block, RA> BlockOf for Client<B, E, Block, RA>where B: Backend<Block>, E: CallExecutor<Block>, Block: BlockT,

§

type Type = Block

The type of the block.
source§

impl<B, E, Block, RA> BlockchainEvents<Block> for Client<B, E, Block, RA>where E: CallExecutor<Block>, Block: BlockT,

source§

fn import_notification_stream(&self) -> ImportNotifications<Block>

Get block import event stream.

source§

fn storage_changes_notification_stream( &self, filter_keys: Option<&[StorageKey]>, child_filter_keys: Option<&[(StorageKey, Option<Vec<StorageKey>>)]> ) -> Result<StorageEventStream<Block::Hash>>

Get storage changes event stream.

source§

fn every_import_notification_stream(&self) -> ImportNotifications<Block>

Get a stream of every imported block.
source§

fn finality_notification_stream(&self) -> FinalityNotifications<Block>

Get a stream of finality notifications. Not guaranteed to be fired for every finalized block.
source§

impl<B, E, Block, RA> CallApiAt<Block> for Client<B, E, Block, RA>where B: Backend<Block>, E: CallExecutor<Block, Backend = B> + Send + Sync, Block: BlockT, RA: Send + Sync,

§

type StateBackend = <B as Backend<Block>>::State

The state backend that is used to store the block states.
source§

fn call_api_at( &self, params: CallApiAtParams<'_, Block> ) -> Result<Vec<u8>, ApiError>

Calls the given api function with the given encoded arguments at the given block and returns the encoded result.
source§

fn runtime_version_at( &self, hash: Block::Hash ) -> Result<RuntimeVersion, ApiError>

Returns the runtime version at the given block.
source§

fn state_at(&self, at: Block::Hash) -> Result<Self::StateBackend, ApiError>

Get the state at the given block.
source§

fn initialize_extensions( &self, at: Block::Hash, extensions: &mut Extensions ) -> Result<(), ApiError>

Initialize the extensions for the given block at by using the global extensions factory.
source§

impl<BE, E, B, RA> Chain<B> for Client<BE, E, B, RA>where BE: Backend<B>, E: CallExecutor<B>, B: BlockT,

source§

fn block_status( &self, hash: B::Hash ) -> Result<BlockStatus, Box<dyn Error + Send>>

Retrieve the status of the block denoted by the given Block::Hash.
source§

impl<B, E, Block, RA> ExecutorProvider<Block> for Client<B, E, Block, RA>where B: Backend<Block>, E: CallExecutor<Block>, Block: BlockT,

§

type Executor = E

executor instance
source§

fn executor(&self) -> &Self::Executor

Get call executor reference.
source§

fn execution_extensions(&self) -> &ExecutionExtensions<Block>

Get a reference to the execution extensions.
source§

impl<B, E, Block, RA> Finalizer<Block, B> for &Client<B, E, Block, RA>where B: Backend<Block>, E: CallExecutor<Block>, Block: BlockT,

source§

fn apply_finality( &self, operation: &mut ClientImportOperation<Block, B>, hash: Block::Hash, justification: Option<Justification>, notify: bool ) -> Result<()>

Mark all blocks up to given as finalized in operation. Read more
source§

fn finalize_block( &self, hash: Block::Hash, justification: Option<Justification>, notify: bool ) -> Result<()>

Finalize a block. Read more
source§

impl<B, E, Block, RA> Finalizer<Block, B> for Client<B, E, Block, RA>where B: Backend<Block>, E: CallExecutor<Block>, Block: BlockT,

source§

fn apply_finality( &self, operation: &mut ClientImportOperation<Block, B>, hash: Block::Hash, justification: Option<Justification>, notify: bool ) -> Result<()>

Mark all blocks up to given as finalized in operation. Read more
source§

fn finalize_block( &self, hash: Block::Hash, justification: Option<Justification>, notify: bool ) -> Result<()>

Finalize a block. Read more
source§

impl<B, E, Block, RA> HeaderBackend<Block> for &Client<B, E, Block, RA>where B: Backend<Block>, E: CallExecutor<Block> + Send + Sync, Block: BlockT, RA: Send + Sync,

source§

fn header(&self, hash: Block::Hash) -> Result<Option<Block::Header>>

Get block header. Returns None if block is not found.
source§

fn info(&self) -> Info<Block>

Get blockchain info.
source§

fn status(&self, hash: Block::Hash) -> Result<BlockStatus>

Get block status.
source§

fn number( &self, hash: Block::Hash ) -> Result<Option<<<Block as BlockT>::Header as HeaderT>::Number>>

Get block number by hash. Returns None if the header is not in the chain.
source§

fn hash(&self, number: NumberFor<Block>) -> Result<Option<Block::Hash>>

Get block hash by number. Returns None if the header is not in the chain.
source§

fn block_hash_from_id( &self, id: &BlockId<Block> ) -> Result<Option<<Block as Block>::Hash>, Error>

Convert an arbitrary block ID into a block hash.
source§

fn block_number_from_id( &self, id: &BlockId<Block> ) -> Result<Option<<<Block as Block>::Header as Header>::Number>, Error>

Convert an arbitrary block ID into a block hash.
source§

fn expect_header( &self, hash: <Block as Block>::Hash ) -> Result<<Block as Block>::Header, Error>

Get block header. Returns UnknownBlock error if block is not found.
source§

fn expect_block_number_from_id( &self, id: &BlockId<Block> ) -> Result<<<Block as Block>::Header as Header>::Number, Error>

Convert an arbitrary block ID into a block number. Returns UnknownBlock error if block is not found.
source§

fn expect_block_hash_from_id( &self, id: &BlockId<Block> ) -> Result<<Block as Block>::Hash, Error>

Convert an arbitrary block ID into a block hash. Returns UnknownBlock error if block is not found.
source§

impl<B, E, Block, RA> HeaderBackend<Block> for Client<B, E, Block, RA>where B: Backend<Block>, E: CallExecutor<Block> + Send + Sync, Block: BlockT, RA: Send + Sync,

source§

fn header(&self, hash: Block::Hash) -> Result<Option<Block::Header>>

Get block header. Returns None if block is not found.
source§

fn info(&self) -> Info<Block>

Get blockchain info.
source§

fn status(&self, hash: Block::Hash) -> Result<BlockStatus>

Get block status.
source§

fn number( &self, hash: Block::Hash ) -> Result<Option<<<Block as BlockT>::Header as HeaderT>::Number>>

Get block number by hash. Returns None if the header is not in the chain.
source§

fn hash(&self, number: NumberFor<Block>) -> Result<Option<Block::Hash>>

Get block hash by number. Returns None if the header is not in the chain.
source§

fn block_hash_from_id( &self, id: &BlockId<Block> ) -> Result<Option<<Block as Block>::Hash>, Error>

Convert an arbitrary block ID into a block hash.
source§

fn block_number_from_id( &self, id: &BlockId<Block> ) -> Result<Option<<<Block as Block>::Header as Header>::Number>, Error>

Convert an arbitrary block ID into a block hash.
source§

fn expect_header( &self, hash: <Block as Block>::Hash ) -> Result<<Block as Block>::Header, Error>

Get block header. Returns UnknownBlock error if block is not found.
source§

fn expect_block_number_from_id( &self, id: &BlockId<Block> ) -> Result<<<Block as Block>::Header as Header>::Number, Error>

Convert an arbitrary block ID into a block number. Returns UnknownBlock error if block is not found.
source§

fn expect_block_hash_from_id( &self, id: &BlockId<Block> ) -> Result<<Block as Block>::Hash, Error>

Convert an arbitrary block ID into a block hash. Returns UnknownBlock error if block is not found.
source§

impl<B, E, Block, RA> HeaderMetadata<Block> for Client<B, E, Block, RA>where B: Backend<Block>, E: CallExecutor<Block>, Block: BlockT,

§

type Error = Error

Error used in case the header metadata is not found.
source§

fn header_metadata( &self, hash: Block::Hash ) -> Result<CachedHeaderMetadata<Block>, Self::Error>

source§

fn insert_header_metadata( &self, hash: Block::Hash, metadata: CachedHeaderMetadata<Block> )

source§

fn remove_header_metadata(&self, hash: Block::Hash)

source§

impl<BE, E, B, RA> IndexedBody<B> for Client<BE, E, B, RA>where BE: Backend<B>, E: CallExecutor<B>, B: BlockT,

source§

fn block_indexed_body( &self, number: NumberFor<B> ) -> Result<Option<Vec<Vec<u8>>>, Error>

Get all indexed transactions for a block, including renewed transactions. Read more
source§

fn number(&self, hash: B::Hash) -> Result<Option<NumberFor<B>>, Error>

Get block number for a block hash.
source§

impl<B, E, Block, RA> LockImportRun<Block, B> for &Client<B, E, Block, RA>where Block: BlockT, B: Backend<Block>, E: CallExecutor<Block>,

source§

fn lock_import_and_run<R, Err, F>(&self, f: F) -> Result<R, Err>where F: FnOnce(&mut ClientImportOperation<Block, B>) -> Result<R, Err>, Err: From<Error>,

Lock the import lock, and run operations inside.
source§

impl<B, E, Block, RA> LockImportRun<Block, B> for Client<B, E, Block, RA>where B: Backend<Block>, E: CallExecutor<Block>, Block: BlockT,

source§

fn lock_import_and_run<R, Err, F>(&self, f: F) -> Result<R, Err>where F: FnOnce(&mut ClientImportOperation<Block, B>) -> Result<R, Err>, Err: From<Error>,

Lock the import lock, and run operations inside.
source§

impl<B, E, Block, RA> PreCommitActions<Block> for Client<B, E, Block, RA>where Block: BlockT,

source§

fn register_import_action(&self, action: OnImportAction<Block>)

Actions to be performed on block import.
source§

fn register_finality_action(&self, action: OnFinalityAction<Block>)

Actions to be performed on block finalization.
source§

impl<B, E, Block, RA> ProofProvider<Block> for Client<B, E, Block, RA>where B: Backend<Block>, E: CallExecutor<Block>, Block: BlockT,

source§

fn read_proof( &self, hash: Block::Hash, keys: &mut dyn Iterator<Item = &[u8]> ) -> Result<StorageProof>

Reads storage value at a given block + key, returning read proof.
source§

fn read_child_proof( &self, hash: Block::Hash, child_info: &ChildInfo, keys: &mut dyn Iterator<Item = &[u8]> ) -> Result<StorageProof>

Reads child storage value at a given block + storage_key + key, returning read proof.
source§

fn execution_proof( &self, hash: Block::Hash, method: &str, call_data: &[u8] ) -> Result<(Vec<u8>, StorageProof)>

Execute a call to a contract on top of state in a block of given hash AND returning execution proof. Read more
source§

fn read_proof_collection( &self, hash: Block::Hash, start_key: &[Vec<u8>], size_limit: usize ) -> Result<(CompactProof, u32)>

Given a Hash iterate over all storage values starting at start_keys. Last start_keys element contains last accessed key value. With multiple start_keys, first start_keys element is the current storage key of of the last accessed child trie. at last level the value to start at exclusively. Proofs is build until size limit is reached and always include at least one key following start_keys. Returns combined proof and the numbers of collected keys.
source§

fn storage_collection( &self, hash: Block::Hash, start_key: &[Vec<u8>], size_limit: usize ) -> Result<Vec<(KeyValueStorageLevel, bool)>>

Given a Hash iterate over all storage values starting at start_key. Returns collected keys and values. Returns the collected keys values content of the top trie followed by the collected keys values of child tries. Only child tries with their root part of the collected content or related to start_key are attached. For each collected state a boolean indicates if state reach end.
source§

fn verify_range_proof( &self, root: Block::Hash, proof: CompactProof, start_key: &[Vec<u8>] ) -> Result<(KeyValueStates, usize)>

Verify read storage proof for a set of keys. Returns collected key-value pairs and a the nested state depth of current iteration or 0 if completed.
source§

impl<B, E, Block, RA> ProvideRuntimeApi<Block> for Client<B, E, Block, RA>where B: Backend<Block>, E: CallExecutor<Block, Backend = B> + Send + Sync, Block: BlockT, RA: ConstructRuntimeApi<Block, Self> + Send + Sync,

§

type Api = <RA as ConstructRuntimeApi<Block, Client<B, E, Block, RA>>>::RuntimeApi

The concrete type that provides the api.
source§

fn runtime_api(&self) -> ApiRef<'_, Self::Api>

Returns the runtime api. The returned instance will keep track of modifications to the storage. Any successful call to an api function, will commit its changes to an internal buffer. Otherwise, the modifications will be discarded. The modifications will not be applied to the storage, even on a commit.
source§

impl<B, E, Block, RA> ProvideUncles<Block> for Client<B, E, Block, RA>where B: Backend<Block>, E: CallExecutor<Block>, Block: BlockT,

source§

fn uncles( &self, target_hash: Block::Hash, max_generation: NumberFor<Block> ) -> Result<Vec<Block::Header>>

Gets the uncles of the block with target_hash going back max_generation ancestors.
source§

impl<B, E, Block, RA> StorageProvider<Block, B> for Client<B, E, Block, RA>where B: Backend<Block>, E: CallExecutor<Block>, Block: BlockT,

source§

fn storage_keys( &self, hash: <Block as BlockT>::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 child_storage_keys( &self, hash: <Block as BlockT>::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 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 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 as BlockT>::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 child_storage( &self, hash: <Block as BlockT>::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_hash( &self, hash: <Block as BlockT>::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.
source§

impl<B, E, Block, RA> UsageProvider<Block> for Client<B, E, Block, RA>where B: Backend<Block>, E: CallExecutor<Block>, Block: BlockT,

source§

fn usage_info(&self) -> ClientInfo<Block>

Get usage info about current client.

Auto Trait Implementations§

§

impl<B, E, Block, RA> !RefUnwindSafe for Client<B, E, Block, RA>

§

impl<B, E, Block, RA> Send for Client<B, E, Block, RA>where B: Send + Sync, E: Send, RA: Send,

§

impl<B, E, Block, RA> Sync for Client<B, E, Block, RA>where B: Send + Sync, E: Sync, RA: Sync,

§

impl<B, E, Block, RA> Unpin for Client<B, E, Block, RA>where E: Unpin, RA: Unpin, <Block as Block>::Hash: Unpin, <<Block as Block>::Header as Header>::Number: Unpin,

§

impl<B, E, Block, RA> !UnwindSafe for Client<B, E, Block, RA>

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for Twhere T: Any,

§

fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send + 'static>

source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CheckedConversion for T

source§

fn checked_from<T>(t: T) -> Option<Self>where Self: TryFrom<T>,

Convert from a value of T into an equivalent instance of Option<Self>. Read more
source§

fn checked_into<T>(self) -> Option<T>where Self: TryInto<T>,

Consume self to return Some equivalent value of Option<T>. Read more
source§

impl<Block, T> ForkBackend<Block> for Twhere Block: Block, T: HeaderMetadata<Block> + HeaderBackend<Block> + Send + Sync,

source§

fn expand_forks( &self, fork_heads: &[<Block as Block>::Hash] ) -> Result<BTreeSet<<Block as Block>::Hash, Global>, (BTreeSet<<Block as Block>::Hash, Global>, Error)>

Best effort to get all the header hashes that are part of the provided forks starting only from the fork heads. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, Outer> IsWrappedBy<Outer> for Twhere Outer: AsRef<T> + AsMut<T> + From<T>, T: From<Outer>,

source§

fn from_ref(outer: &Outer) -> &T

Get a reference to the inner from the outer.

source§

fn from_mut(outer: &mut Outer) -> &mut T

Get a mutable reference to the inner from the outer.

§

impl<T> Pointable for T

§

const ALIGN: usize = mem::align_of::<T>()

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> SaturatedConversion for T

source§

fn saturated_from<T>(t: T) -> Selfwhere Self: UniqueSaturatedFrom<T>,

Convert from a value of T into an equivalent instance of Self. Read more
source§

fn saturated_into<T>(self) -> Twhere Self: UniqueSaturatedInto<T>,

Consume self to return an equivalent value of T. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<S, T> UncheckedInto<T> for Swhere T: UncheckedFrom<S>,

source§

fn unchecked_into(self) -> T

The counterpart to unchecked_from.
source§

impl<T, S> UniqueSaturatedInto<T> for Swhere T: Bounded, S: TryInto<T>,

source§

fn unique_saturated_into(self) -> T

Consume self to return an equivalent value of T.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
§

impl<T> JsonSchemaMaybe for T

§

impl<T> MaybeSend for Twhere T: Send,