Struct cumulus_test_client::client::Client
pub struct Client<B, E, Block, RA>where
Block: Block,{ /* private fields */ }
Expand description
Substrate Client
Implementations§
§impl<B, E, Block, RA> Client<B, E, Block, RA>
impl<B, E, Block, RA> Client<B, E, Block, RA>
pub fn new<G>(
backend: Arc<B>,
executor: E,
spawn_handle: Box<dyn SpawnNamed>,
genesis_block_builder: G,
fork_blocks: Option<Vec<(<<Block as Block>::Header as Header>::Number, <Block as Block>::Hash)>>,
bad_blocks: Option<HashSet<<Block as Block>::Hash>>,
prometheus_registry: Option<Registry>,
telemetry: Option<TelemetryHandle>,
config: ClientConfig<Block>,
) -> Result<Client<B, E, Block, RA>, Error>where
G: BuildGenesisBlock<Block, BlockImportOperation = <B as Backend<Block>>::BlockImportOperation>,
E: Clone,
B: 'static,
pub fn new<G>(
backend: Arc<B>,
executor: E,
spawn_handle: Box<dyn SpawnNamed>,
genesis_block_builder: G,
fork_blocks: Option<Vec<(<<Block as Block>::Header as Header>::Number, <Block as Block>::Hash)>>,
bad_blocks: Option<HashSet<<Block as Block>::Hash>>,
prometheus_registry: Option<Registry>,
telemetry: Option<TelemetryHandle>,
config: ClientConfig<Block>,
) -> Result<Client<B, E, Block, RA>, Error>where
G: BuildGenesisBlock<Block, BlockImportOperation = <B as Backend<Block>>::BlockImportOperation>,
E: Clone,
B: 'static,
Creates new Substrate Client with given blockchain and code executor.
pub fn import_notification_sinks(
&self,
) -> &Mutex<RawMutex, Vec<TracingUnboundedSender<BlockImportNotification<Block>>>>
pub fn import_notification_sinks( &self, ) -> &Mutex<RawMutex, Vec<TracingUnboundedSender<BlockImportNotification<Block>>>>
returns a reference to the block import notification sinks useful for test environments.
pub fn finality_notification_sinks(
&self,
) -> &Mutex<RawMutex, Vec<TracingUnboundedSender<FinalityNotification<Block>>>>
pub fn finality_notification_sinks( &self, ) -> &Mutex<RawMutex, Vec<TracingUnboundedSender<FinalityNotification<Block>>>>
returns a reference to the finality notification sinks useful for test environments.
pub fn state_at(
&self,
hash: <Block as Block>::Hash,
) -> Result<<B as Backend<Block>>::State, Error>
pub fn state_at( &self, hash: <Block as Block>::Hash, ) -> Result<<B as Backend<Block>>::State, Error>
Get a reference to the state at a given block.
pub fn code_at(&self, hash: <Block as Block>::Hash) -> Result<Vec<u8>, Error>
pub fn code_at(&self, hash: <Block as Block>::Hash) -> Result<Vec<u8>, Error>
Get the code at a given block.
This takes any potential substitutes into account, but ignores overrides.
pub fn runtime_version_at(
&self,
hash: <Block as Block>::Hash,
) -> Result<RuntimeVersion, Error>
pub fn runtime_version_at( &self, hash: <Block as Block>::Hash, ) -> Result<RuntimeVersion, Error>
Get the RuntimeVersion at a given block.
pub fn revert(
&self,
n: <<Block as Block>::Header as Header>::Number,
) -> Result<<<Block as Block>::Header as Header>::Number, Error>
pub fn revert( &self, n: <<Block as Block>::Header as Header>::Number, ) -> Result<<<Block as Block>::Header as Header>::Number, Error>
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.
pub fn unsafe_revert(
&mut self,
n: <<Block as Block>::Header as Header>::Number,
blacklist: bool,
) -> Result<<<Block as Block>::Header as Header>::Number, Error>
pub fn unsafe_revert( &mut self, n: <<Block as Block>::Header as Header>::Number, blacklist: bool, ) -> Result<<<Block as Block>::Header as Header>::Number, Error>
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.
pub fn chain_info(&self) -> Info<Block>
pub fn chain_info(&self) -> Info<Block>
Get blockchain info.
pub fn block_status(
&self,
hash: <Block as Block>::Hash,
) -> Result<BlockStatus, Error>
pub fn block_status( &self, hash: <Block as Block>::Hash, ) -> Result<BlockStatus, Error>
Get block status.
pub fn header(
&self,
hash: <Block as Block>::Hash,
) -> Result<Option<<Block as Block>::Header>, Error>
pub fn header( &self, hash: <Block as Block>::Hash, ) -> Result<Option<<Block as Block>::Header>, Error>
Get block header by id.
Trait Implementations§
§impl<B, E, Block, RA> AuxStore for &Client<B, E, Block, RA>where
B: Backend<Block>,
E: CallExecutor<Block>,
Block: Block,
Client<B, E, Block, RA>: ProvideRuntimeApi<Block>,
<Client<B, E, Block, RA> as ProvideRuntimeApi<Block>>::Api: Core<Block>,
impl<B, E, Block, RA> AuxStore for &Client<B, E, Block, RA>where
B: Backend<Block>,
E: CallExecutor<Block>,
Block: Block,
Client<B, E, Block, RA>: ProvideRuntimeApi<Block>,
<Client<B, E, Block, RA> as ProvideRuntimeApi<Block>>::Api: Core<Block>,
§fn insert_aux<'a, 'b, 'c, I, D>(
&self,
insert: I,
delete: D,
) -> Result<(), Error>where
'b: 'a,
'c: 'a,
I: IntoIterator<Item = &'a (&'c [u8], &'c [u8])>,
D: IntoIterator<Item = &'a &'b [u8]>,
fn insert_aux<'a, 'b, 'c, I, D>(
&self,
insert: I,
delete: D,
) -> Result<(), Error>where
'b: 'a,
'c: 'a,
I: IntoIterator<Item = &'a (&'c [u8], &'c [u8])>,
D: IntoIterator<Item = &'a &'b [u8]>,
§impl<B, E, Block, RA> AuxStore for Client<B, E, Block, RA>where
B: Backend<Block>,
E: CallExecutor<Block>,
Block: Block,
Client<B, E, Block, RA>: ProvideRuntimeApi<Block>,
<Client<B, E, Block, RA> as ProvideRuntimeApi<Block>>::Api: Core<Block>,
impl<B, E, Block, RA> AuxStore for Client<B, E, Block, RA>where
B: Backend<Block>,
E: CallExecutor<Block>,
Block: Block,
Client<B, E, Block, RA>: ProvideRuntimeApi<Block>,
<Client<B, E, Block, RA> as ProvideRuntimeApi<Block>>::Api: Core<Block>,
§fn insert_aux<'a, 'b, 'c, I, D>(
&self,
insert: I,
delete: D,
) -> Result<(), Error>where
'b: 'a,
'c: 'a,
I: IntoIterator<Item = &'a (&'c [u8], &'c [u8])>,
D: IntoIterator<Item = &'a &'b [u8]>,
fn insert_aux<'a, 'b, 'c, I, D>(
&self,
insert: I,
delete: D,
) -> Result<(), Error>where
'b: 'a,
'c: 'a,
I: IntoIterator<Item = &'a (&'c [u8], &'c [u8])>,
D: IntoIterator<Item = &'a &'b [u8]>,
Insert auxiliary data into key-value store.
§impl<B, E, Block, RA> BlockBackend<Block> for Client<B, E, Block, RA>
impl<B, E, Block, RA> BlockBackend<Block> for Client<B, E, Block, RA>
§fn block_body(
&self,
hash: <Block as Block>::Hash,
) -> Result<Option<Vec<<Block as Block>::Extrinsic>>, Error>
fn block_body( &self, hash: <Block as Block>::Hash, ) -> Result<Option<Vec<<Block as Block>::Extrinsic>>, Error>
None
if the body is not stored.§fn block(
&self,
hash: <Block as Block>::Hash,
) -> Result<Option<SignedBlock<Block>>, Error>
fn block( &self, hash: <Block as Block>::Hash, ) -> Result<Option<SignedBlock<Block>>, Error>
§fn block_status(
&self,
hash: <Block as Block>::Hash,
) -> Result<BlockStatus, Error>
fn block_status( &self, hash: <Block as Block>::Hash, ) -> Result<BlockStatus, Error>
§fn justifications(
&self,
hash: <Block as Block>::Hash,
) -> Result<Option<Justifications>, Error>
fn justifications( &self, hash: <Block as Block>::Hash, ) -> Result<Option<Justifications>, Error>
§fn block_hash(
&self,
number: <<Block as Block>::Header as Header>::Number,
) -> Result<Option<<Block as Block>::Hash>, Error>
fn block_hash( &self, number: <<Block as Block>::Header as Header>::Number, ) -> Result<Option<<Block as Block>::Hash>, Error>
§fn indexed_transaction(
&self,
hash: <Block as Block>::Hash,
) -> Result<Option<Vec<u8>>, Error>
fn indexed_transaction( &self, hash: <Block as Block>::Hash, ) -> Result<Option<Vec<u8>>, Error>
§fn has_indexed_transaction(
&self,
hash: <Block as Block>::Hash,
) -> Result<bool, Error>
fn has_indexed_transaction( &self, hash: <Block as Block>::Hash, ) -> Result<bool, Error>
§fn block_indexed_body(
&self,
hash: <Block as Block>::Hash,
) -> Result<Option<Vec<Vec<u8>>>, Error>
fn block_indexed_body( &self, hash: <Block as Block>::Hash, ) -> Result<Option<Vec<Vec<u8>>>, Error>
§fn requires_full_sync(&self) -> bool
fn requires_full_sync(&self) -> bool
§impl<B, E, Block, RA> BlockIdTo<Block> for Client<B, E, Block, RA>
impl<B, E, Block, RA> BlockIdTo<Block> for Client<B, E, Block, RA>
§impl<B, E, Block, RA> BlockImport<Block> for &Client<B, E, Block, RA>where
B: Backend<Block>,
E: CallExecutor<Block> + Send + Sync,
Block: Block,
Client<B, E, Block, RA>: ProvideRuntimeApi<Block>,
<Client<B, E, Block, RA> as ProvideRuntimeApi<Block>>::Api: Core<Block> + ApiExt<Block>,
RA: Sync + Send,
impl<B, E, Block, RA> BlockImport<Block> for &Client<B, E, Block, RA>where
B: Backend<Block>,
E: CallExecutor<Block> + Send + Sync,
Block: Block,
Client<B, E, Block, RA>: ProvideRuntimeApi<Block>,
<Client<B, E, Block, RA> as ProvideRuntimeApi<Block>>::Api: Core<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.
§fn import_block<'life0, 'async_trait>(
&'life0 self,
import_block: BlockImportParams<Block>,
) -> Pin<Box<dyn Future<Output = Result<ImportResult, <&Client<B, E, Block, RA> as BlockImport<Block>>::Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
&Client<B, E, Block, RA>: 'async_trait,
fn import_block<'life0, 'async_trait>(
&'life0 self,
import_block: BlockImportParams<Block>,
) -> Pin<Box<dyn Future<Output = Result<ImportResult, <&Client<B, E, Block, RA> as BlockImport<Block>>::Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
&Client<B, E, Block, RA>: 'async_trait,
Import a checked and validated block.
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.
§fn check_block<'life0, 'async_trait>(
&'life0 self,
block: BlockCheckParams<Block>,
) -> Pin<Box<dyn Future<Output = Result<ImportResult, <&Client<B, E, Block, RA> as BlockImport<Block>>::Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
&Client<B, E, Block, RA>: 'async_trait,
fn check_block<'life0, 'async_trait>(
&'life0 self,
block: BlockCheckParams<Block>,
) -> Pin<Box<dyn Future<Output = Result<ImportResult, <&Client<B, E, Block, RA> as BlockImport<Block>>::Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
&Client<B, E, Block, RA>: 'async_trait,
Check block preconditions.
§impl<B, E, Block, RA> BlockImport<Block> for Client<B, E, Block, RA>where
B: Backend<Block>,
E: CallExecutor<Block> + Send + Sync,
Block: Block,
Client<B, E, Block, RA>: ProvideRuntimeApi<Block>,
<Client<B, E, Block, RA> as ProvideRuntimeApi<Block>>::Api: Core<Block> + ApiExt<Block>,
RA: Sync + Send,
impl<B, E, Block, RA> BlockImport<Block> for Client<B, E, Block, RA>where
B: Backend<Block>,
E: CallExecutor<Block> + Send + Sync,
Block: Block,
Client<B, E, Block, RA>: ProvideRuntimeApi<Block>,
<Client<B, E, Block, RA> as ProvideRuntimeApi<Block>>::Api: Core<Block> + ApiExt<Block>,
RA: Sync + Send,
§fn check_block<'life0, 'async_trait>(
&'life0 self,
block: BlockCheckParams<Block>,
) -> Pin<Box<dyn Future<Output = Result<ImportResult, <Client<B, E, Block, RA> as BlockImport<Block>>::Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Client<B, E, Block, RA>: 'async_trait,
fn check_block<'life0, 'async_trait>(
&'life0 self,
block: BlockCheckParams<Block>,
) -> Pin<Box<dyn Future<Output = Result<ImportResult, <Client<B, E, Block, RA> as BlockImport<Block>>::Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Client<B, E, Block, RA>: 'async_trait,
§fn import_block<'life0, 'async_trait>(
&'life0 self,
import_block: BlockImportParams<Block>,
) -> Pin<Box<dyn Future<Output = Result<ImportResult, <Client<B, E, Block, RA> as BlockImport<Block>>::Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Client<B, E, Block, RA>: 'async_trait,
fn import_block<'life0, 'async_trait>(
&'life0 self,
import_block: BlockImportParams<Block>,
) -> Pin<Box<dyn Future<Output = Result<ImportResult, <Client<B, E, Block, RA> as BlockImport<Block>>::Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Client<B, E, Block, RA>: 'async_trait,
§impl<B, E, Block, RA> BlockchainEvents<Block> for Client<B, E, Block, RA>where
E: CallExecutor<Block>,
Block: Block,
impl<B, E, Block, RA> BlockchainEvents<Block> for Client<B, E, Block, RA>where
E: CallExecutor<Block>,
Block: Block,
§fn import_notification_stream(
&self,
) -> TracingUnboundedReceiver<BlockImportNotification<Block>>
fn import_notification_stream( &self, ) -> TracingUnboundedReceiver<BlockImportNotification<Block>>
Get block import event stream.
§fn storage_changes_notification_stream(
&self,
filter_keys: Option<&[StorageKey]>,
child_filter_keys: Option<&[(StorageKey, Option<Vec<StorageKey>>)]>,
) -> Result<StorageEventStream<<Block as Block>::Hash>, Error>
fn storage_changes_notification_stream( &self, filter_keys: Option<&[StorageKey]>, child_filter_keys: Option<&[(StorageKey, Option<Vec<StorageKey>>)]>, ) -> Result<StorageEventStream<<Block as Block>::Hash>, Error>
Get storage changes event stream.
§fn every_import_notification_stream(
&self,
) -> TracingUnboundedReceiver<BlockImportNotification<Block>>
fn every_import_notification_stream( &self, ) -> TracingUnboundedReceiver<BlockImportNotification<Block>>
§fn finality_notification_stream(
&self,
) -> TracingUnboundedReceiver<FinalityNotification<Block>>
fn finality_notification_stream( &self, ) -> TracingUnboundedReceiver<FinalityNotification<Block>>
§impl<B, E, Block, RA> CallApiAt<Block> for Client<B, E, Block, RA>
impl<B, E, Block, RA> CallApiAt<Block> for Client<B, E, Block, RA>
§type StateBackend = <B as Backend<Block>>::State
type StateBackend = <B as Backend<Block>>::State
§fn call_api_at(
&self,
params: CallApiAtParams<'_, Block>,
) -> Result<Vec<u8>, ApiError>
fn call_api_at( &self, params: CallApiAtParams<'_, Block>, ) -> Result<Vec<u8>, ApiError>
§fn runtime_version_at(
&self,
hash: <Block as Block>::Hash,
) -> Result<RuntimeVersion, ApiError>
fn runtime_version_at( &self, hash: <Block as Block>::Hash, ) -> Result<RuntimeVersion, ApiError>
§fn state_at(
&self,
at: <Block as Block>::Hash,
) -> Result<<Client<B, E, Block, RA> as CallApiAt<Block>>::StateBackend, ApiError>
fn state_at( &self, at: <Block as Block>::Hash, ) -> Result<<Client<B, E, Block, RA> as CallApiAt<Block>>::StateBackend, ApiError>
at
the given block.§fn initialize_extensions(
&self,
at: <Block as Block>::Hash,
extensions: &mut Extensions,
) -> Result<(), ApiError>
fn initialize_extensions( &self, at: <Block as Block>::Hash, extensions: &mut Extensions, ) -> Result<(), ApiError>
extensions
for the given block at
by using the global extensions factory.§impl<BE, E, B, RA> Chain<B> for Client<BE, E, B, RA>
impl<BE, E, B, RA> Chain<B> for Client<BE, E, B, RA>
§fn block_status(
&self,
hash: <B as Block>::Hash,
) -> Result<BlockStatus, Box<dyn Error + Send>>
fn block_status( &self, hash: <B as Block>::Hash, ) -> Result<BlockStatus, Box<dyn Error + Send>>
Block::Hash
.§impl<B, E, RA, Block> ClientBlockImportExt<Block> for Client<B, E, Block, RA>
impl<B, E, RA, Block> ClientBlockImportExt<Block> for Client<B, E, Block, RA>
§fn import<'life0, 'async_trait>(
&'life0 self,
origin: BlockOrigin,
block: Block,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Client<B, E, Block, RA>: 'async_trait,
fn import<'life0, 'async_trait>(
&'life0 self,
origin: BlockOrigin,
block: Block,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Client<B, E, Block, RA>: 'async_trait,
§fn import_as_best<'life0, 'async_trait>(
&'life0 self,
origin: BlockOrigin,
block: Block,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Client<B, E, Block, RA>: 'async_trait,
fn import_as_best<'life0, 'async_trait>(
&'life0 self,
origin: BlockOrigin,
block: Block,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Client<B, E, Block, RA>: 'async_trait,
§fn import_as_final<'life0, 'async_trait>(
&'life0 self,
origin: BlockOrigin,
block: Block,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Client<B, E, Block, RA>: 'async_trait,
fn import_as_final<'life0, 'async_trait>(
&'life0 self,
origin: BlockOrigin,
block: Block,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Client<B, E, Block, RA>: 'async_trait,
§fn import_justified<'life0, 'async_trait>(
&'life0 self,
origin: BlockOrigin,
block: Block,
justifications: Justifications,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Client<B, E, Block, RA>: 'async_trait,
fn import_justified<'life0, 'async_trait>(
&'life0 self,
origin: BlockOrigin,
block: Block,
justifications: Justifications,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Client<B, E, Block, RA>: 'async_trait,
§impl<B, E, RA, Block> ClientExt<Block> for Client<B, E, Block, RA>where
B: Backend<Block>,
E: CallExecutor<Block> + RuntimeVersionOf + 'static,
Client<B, E, Block, RA>: BlockImport<Block, Error = Error>,
Block: Block,
impl<B, E, RA, Block> ClientExt<Block> for Client<B, E, Block, RA>where
B: Backend<Block>,
E: CallExecutor<Block> + RuntimeVersionOf + 'static,
Client<B, E, Block, RA>: BlockImport<Block, Error = Error>,
Block: Block,
§impl<B, E, Block, RA> ExecutorProvider<Block> for Client<B, E, Block, RA>
impl<B, E, Block, RA> ExecutorProvider<Block> for Client<B, E, Block, RA>
§fn executor(
&self,
) -> &<Client<B, E, Block, RA> as ExecutorProvider<Block>>::Executor
fn executor( &self, ) -> &<Client<B, E, Block, RA> as ExecutorProvider<Block>>::Executor
§fn execution_extensions(&self) -> &ExecutionExtensions<Block>
fn execution_extensions(&self) -> &ExecutionExtensions<Block>
§impl<B, E, Block, RA> Finalizer<Block, B> for &Client<B, E, Block, RA>
impl<B, E, Block, RA> Finalizer<Block, B> for &Client<B, E, Block, RA>
§impl<B, E, Block, RA> Finalizer<Block, B> for Client<B, E, Block, RA>
impl<B, E, Block, RA> Finalizer<Block, B> for Client<B, E, Block, RA>
§impl<B, E, Block, RA> HeaderBackend<Block> for &Client<B, E, Block, RA>
impl<B, E, Block, RA> HeaderBackend<Block> for &Client<B, E, Block, RA>
§fn header(
&self,
hash: <Block as Block>::Hash,
) -> Result<Option<<Block as Block>::Header>, Error>
fn header( &self, hash: <Block as Block>::Hash, ) -> Result<Option<<Block as Block>::Header>, Error>
None
if block is not found.§fn number(
&self,
hash: <Block as Block>::Hash,
) -> Result<Option<<<Block as Block>::Header as Header>::Number>, Error>
fn number( &self, hash: <Block as Block>::Hash, ) -> Result<Option<<<Block as Block>::Header as Header>::Number>, Error>
None
if the header is not in the chain.§fn hash(
&self,
number: <<Block as Block>::Header as Header>::Number,
) -> Result<Option<<Block as Block>::Hash>, Error>
fn hash( &self, number: <<Block as Block>::Header as Header>::Number, ) -> Result<Option<<Block as Block>::Hash>, Error>
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>
fn block_hash_from_id( &self, id: &BlockId<Block>, ) -> Result<Option<<Block as Block>::Hash>, Error>
source§fn block_number_from_id(
&self,
id: &BlockId<Block>,
) -> Result<Option<<<Block as Block>::Header as Header>::Number>, Error>
fn block_number_from_id( &self, id: &BlockId<Block>, ) -> Result<Option<<<Block as Block>::Header as Header>::Number>, Error>
source§fn expect_header(
&self,
hash: <Block as Block>::Hash,
) -> Result<<Block as Block>::Header, Error>
fn expect_header( &self, hash: <Block as Block>::Hash, ) -> Result<<Block as Block>::Header, Error>
UnknownBlock
error if block is not found.§impl<B, E, Block, RA> HeaderBackend<Block> for Client<B, E, Block, RA>
impl<B, E, Block, RA> HeaderBackend<Block> for Client<B, E, Block, RA>
§fn header(
&self,
hash: <Block as Block>::Hash,
) -> Result<Option<<Block as Block>::Header>, Error>
fn header( &self, hash: <Block as Block>::Hash, ) -> Result<Option<<Block as Block>::Header>, Error>
None
if block is not found.§fn number(
&self,
hash: <Block as Block>::Hash,
) -> Result<Option<<<Block as Block>::Header as Header>::Number>, Error>
fn number( &self, hash: <Block as Block>::Hash, ) -> Result<Option<<<Block as Block>::Header as Header>::Number>, Error>
None
if the header is not in the chain.§fn hash(
&self,
number: <<Block as Block>::Header as Header>::Number,
) -> Result<Option<<Block as Block>::Hash>, Error>
fn hash( &self, number: <<Block as Block>::Header as Header>::Number, ) -> Result<Option<<Block as Block>::Hash>, Error>
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>
fn block_hash_from_id( &self, id: &BlockId<Block>, ) -> Result<Option<<Block as Block>::Hash>, Error>
source§fn block_number_from_id(
&self,
id: &BlockId<Block>,
) -> Result<Option<<<Block as Block>::Header as Header>::Number>, Error>
fn block_number_from_id( &self, id: &BlockId<Block>, ) -> Result<Option<<<Block as Block>::Header as Header>::Number>, Error>
source§fn expect_header(
&self,
hash: <Block as Block>::Hash,
) -> Result<<Block as Block>::Header, Error>
fn expect_header( &self, hash: <Block as Block>::Hash, ) -> Result<<Block as Block>::Header, Error>
UnknownBlock
error if block is not found.§impl<B, E, Block, RA> HeaderMetadata<Block> for Client<B, E, Block, RA>
impl<B, E, Block, RA> HeaderMetadata<Block> for Client<B, E, Block, RA>
fn header_metadata( &self, hash: <Block as Block>::Hash, ) -> Result<CachedHeaderMetadata<Block>, <Client<B, E, Block, RA> as HeaderMetadata<Block>>::Error>
fn insert_header_metadata( &self, hash: <Block as Block>::Hash, metadata: CachedHeaderMetadata<Block>, )
fn remove_header_metadata(&self, hash: <Block as Block>::Hash)
§impl<BE, E, B, RA> IndexedBody<B> for Client<BE, E, B, RA>
impl<BE, E, B, RA> IndexedBody<B> for Client<BE, E, B, RA>
§impl<B, E, Block, RA> LockImportRun<Block, B> for &Client<B, E, Block, RA>
impl<B, E, Block, RA> LockImportRun<Block, B> for &Client<B, E, Block, RA>
§fn lock_import_and_run<R, Err, F>(&self, f: F) -> Result<R, Err>
fn lock_import_and_run<R, Err, F>(&self, f: F) -> Result<R, Err>
§impl<B, E, Block, RA> LockImportRun<Block, B> for Client<B, E, Block, RA>
impl<B, E, Block, RA> LockImportRun<Block, B> for Client<B, E, Block, RA>
§fn lock_import_and_run<R, Err, F>(&self, f: F) -> Result<R, Err>
fn lock_import_and_run<R, Err, F>(&self, f: F) -> Result<R, Err>
§impl<B, E, Block, RA> PreCommitActions<Block> for Client<B, E, Block, RA>where
Block: Block,
impl<B, E, Block, RA> PreCommitActions<Block> for Client<B, E, Block, RA>where
Block: Block,
§impl<B, E, Block, RA> ProofProvider<Block> for Client<B, E, Block, RA>
impl<B, E, Block, RA> ProofProvider<Block> for Client<B, E, Block, RA>
§fn read_proof(
&self,
hash: <Block as Block>::Hash,
keys: &mut dyn Iterator<Item = &[u8]>,
) -> Result<StorageProof, Error>
fn read_proof( &self, hash: <Block as Block>::Hash, keys: &mut dyn Iterator<Item = &[u8]>, ) -> Result<StorageProof, Error>
§fn read_child_proof(
&self,
hash: <Block as Block>::Hash,
child_info: &ChildInfo,
keys: &mut dyn Iterator<Item = &[u8]>,
) -> Result<StorageProof, Error>
fn read_child_proof( &self, hash: <Block as Block>::Hash, child_info: &ChildInfo, keys: &mut dyn Iterator<Item = &[u8]>, ) -> Result<StorageProof, Error>
§fn execution_proof(
&self,
hash: <Block as Block>::Hash,
method: &str,
call_data: &[u8],
) -> Result<(Vec<u8>, StorageProof), Error>
fn execution_proof( &self, hash: <Block as Block>::Hash, method: &str, call_data: &[u8], ) -> Result<(Vec<u8>, StorageProof), Error>
§fn read_proof_collection(
&self,
hash: <Block as Block>::Hash,
start_key: &[Vec<u8>],
size_limit: usize,
) -> Result<(CompactProof, u32), Error>
fn read_proof_collection( &self, hash: <Block as Block>::Hash, start_key: &[Vec<u8>], size_limit: usize, ) -> Result<(CompactProof, u32), Error>
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.§fn storage_collection(
&self,
hash: <Block as Block>::Hash,
start_key: &[Vec<u8>],
size_limit: usize,
) -> Result<Vec<(KeyValueStorageLevel, bool)>, Error>
fn storage_collection( &self, hash: <Block as Block>::Hash, start_key: &[Vec<u8>], size_limit: usize, ) -> Result<Vec<(KeyValueStorageLevel, bool)>, Error>
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.§fn verify_range_proof(
&self,
root: <Block as Block>::Hash,
proof: CompactProof,
start_key: &[Vec<u8>],
) -> Result<(KeyValueStates, usize), Error>
fn verify_range_proof( &self, root: <Block as Block>::Hash, proof: CompactProof, start_key: &[Vec<u8>], ) -> Result<(KeyValueStates, usize), Error>
§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: Block,
RA: ConstructRuntimeApi<Block, Client<B, E, Block, RA>> + Send + Sync,
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: Block,
RA: ConstructRuntimeApi<Block, Client<B, E, Block, RA>> + Send + Sync,
§type Api = <RA as ConstructRuntimeApi<Block, Client<B, E, Block, RA>>>::RuntimeApi
type Api = <RA as ConstructRuntimeApi<Block, Client<B, E, Block, RA>>>::RuntimeApi
§fn runtime_api(
&self,
) -> ApiRef<'_, <Client<B, E, Block, RA> as ProvideRuntimeApi<Block>>::Api>
fn runtime_api( &self, ) -> ApiRef<'_, <Client<B, E, Block, RA> as ProvideRuntimeApi<Block>>::Api>
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
.§impl<B, E, Block, RA> ProvideUncles<Block> for Client<B, E, Block, RA>
impl<B, E, Block, RA> ProvideUncles<Block> for Client<B, E, Block, RA>
§impl<B, E, Block, RA> StorageProvider<Block, B> for Client<B, E, Block, RA>
impl<B, E, Block, RA> StorageProvider<Block, B> for Client<B, E, Block, RA>
§fn storage_keys(
&self,
hash: <Block as Block>::Hash,
prefix: Option<&StorageKey>,
start_key: Option<&StorageKey>,
) -> Result<KeysIter<<B as Backend<Block>>::State, Block>, Error>
fn storage_keys( &self, hash: <Block as Block>::Hash, prefix: Option<&StorageKey>, start_key: Option<&StorageKey>, ) -> Result<KeysIter<<B as Backend<Block>>::State, Block>, Error>
Hash
and a key prefix, returns a KeysIter
iterates matching storage
keys in that block.§fn child_storage_keys(
&self,
hash: <Block as Block>::Hash,
child_info: ChildInfo,
prefix: Option<&StorageKey>,
start_key: Option<&StorageKey>,
) -> Result<KeysIter<<B as Backend<Block>>::State, Block>, Error>
fn child_storage_keys( &self, hash: <Block as Block>::Hash, child_info: ChildInfo, prefix: Option<&StorageKey>, start_key: Option<&StorageKey>, ) -> Result<KeysIter<<B as Backend<Block>>::State, Block>, Error>
Hash
and a key prefix
and a child storage key,
returns a KeysIter
that iterates matching storage keys in that block.§fn storage_pairs(
&self,
hash: <Block as Block>::Hash,
prefix: Option<&StorageKey>,
start_key: Option<&StorageKey>,
) -> Result<PairsIter<<B as Backend<Block>>::State, Block>, Error>
fn storage_pairs( &self, hash: <Block as Block>::Hash, prefix: Option<&StorageKey>, start_key: Option<&StorageKey>, ) -> Result<PairsIter<<B as Backend<Block>>::State, Block>, Error>
Hash
and a key prefix, returns an iterator over the storage keys and
values in that block.§fn storage(
&self,
hash: <Block as Block>::Hash,
key: &StorageKey,
) -> Result<Option<StorageData>, Error>
fn storage( &self, hash: <Block as Block>::Hash, key: &StorageKey, ) -> Result<Option<StorageData>, Error>
Hash
and a key, return the value under the key in that block.§fn storage_hash(
&self,
hash: <Block as Block>::Hash,
key: &StorageKey,
) -> Result<Option<<Block as Block>::Hash>, Error>
fn storage_hash( &self, hash: <Block as Block>::Hash, key: &StorageKey, ) -> Result<Option<<Block as Block>::Hash>, Error>
Hash
and a key, return the value under the hash in that block.§fn child_storage(
&self,
hash: <Block as Block>::Hash,
child_info: &ChildInfo,
key: &StorageKey,
) -> Result<Option<StorageData>, Error>
fn child_storage( &self, hash: <Block as Block>::Hash, child_info: &ChildInfo, key: &StorageKey, ) -> Result<Option<StorageData>, Error>
Hash
, a key and a child storage key, return the value under the key in
that block.§fn child_storage_hash(
&self,
hash: <Block as Block>::Hash,
child_info: &ChildInfo,
key: &StorageKey,
) -> Result<Option<<Block as Block>::Hash>, Error>
fn child_storage_hash( &self, hash: <Block as Block>::Hash, child_info: &ChildInfo, key: &StorageKey, ) -> Result<Option<<Block as Block>::Hash>, Error>
Hash
, a key and a child storage key, return the hash under the key in that
block.§fn closest_merkle_value(
&self,
hash: <Block as Block>::Hash,
key: &StorageKey,
) -> Result<Option<MerkleValue<<Block as Block>::Hash>>, Error>
fn closest_merkle_value( &self, hash: <Block as Block>::Hash, key: &StorageKey, ) -> Result<Option<MerkleValue<<Block as Block>::Hash>>, Error>
Hash
and a key, return the closest merkle value.§impl<B, E, Block, RA> UsageProvider<Block> for Client<B, E, Block, RA>
impl<B, E, Block, RA> UsageProvider<Block> for Client<B, E, Block, RA>
§fn usage_info(&self) -> ClientInfo<Block>
fn usage_info(&self) -> ClientInfo<Block>
Get usage info about current client.
Auto Trait Implementations§
impl<B, E, Block, RA> !Freeze for Client<B, E, Block, RA>
impl<B, E, Block, RA> !RefUnwindSafe for Client<B, E, Block, RA>
impl<B, E, Block, RA> Send for Client<B, E, Block, RA>
impl<B, E, Block, RA> Sync for Client<B, E, Block, RA>
impl<B, E, Block, RA> Unpin for Client<B, E, Block, RA>
impl<B, E, Block, RA> !UnwindSafe for Client<B, E, Block, RA>
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
§impl<C, B> BlockchainEventsExt<C, B> for Cwhere
C: BlockchainEvents<B>,
B: Block,
impl<C, B> BlockchainEventsExt<C, B> for Cwhere
C: BlockchainEvents<B>,
B: Block,
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> ChainApiBackend for T
impl<T> ChainApiBackend for T
source§fn header<'life0, 'async_trait>(
&'life0 self,
hash: H256,
) -> Pin<Box<dyn Future<Output = Result<Option<Header<u32, BlakeTwo256>>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
T: 'async_trait,
fn header<'life0, 'async_trait>(
&'life0 self,
hash: H256,
) -> Pin<Box<dyn Future<Output = Result<Option<Header<u32, BlakeTwo256>>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
T: 'async_trait,
Get block header. Returns None
if block is not found.
source§fn info<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Info<Block<Header<u32, BlakeTwo256>, OpaqueExtrinsic>>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
T: 'async_trait,
fn info<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Info<Block<Header<u32, BlakeTwo256>, OpaqueExtrinsic>>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
T: 'async_trait,
Get blockchain info.
source§fn number<'life0, 'async_trait>(
&'life0 self,
hash: H256,
) -> Pin<Box<dyn Future<Output = Result<Option<<Header<u32, BlakeTwo256> as Header>::Number>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
T: 'async_trait,
fn number<'life0, 'async_trait>(
&'life0 self,
hash: H256,
) -> Pin<Box<dyn Future<Output = Result<Option<<Header<u32, BlakeTwo256> as Header>::Number>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
T: 'async_trait,
Get block number by hash. Returns None
if the header is not in the chain.
source§fn hash<'life0, 'async_trait>(
&'life0 self,
number: <<Block<Header<u32, BlakeTwo256>, OpaqueExtrinsic> as Block>::Header as Header>::Number,
) -> Pin<Box<dyn Future<Output = Result<Option<H256>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
T: 'async_trait,
fn hash<'life0, 'async_trait>(
&'life0 self,
number: <<Block<Header<u32, BlakeTwo256>, OpaqueExtrinsic> as Block>::Header as Header>::Number,
) -> Pin<Box<dyn Future<Output = Result<Option<H256>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
T: 'async_trait,
Get block hash by number. Returns None
if the header is not in the chain.
source§impl<T> CheckedConversion for T
impl<T> CheckedConversion for T
source§impl<T> CheckedConversion for T
impl<T> CheckedConversion for T
§impl<T> Conv for T
impl<T> Conv for T
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> FmtForward for T
impl<T> FmtForward for T
§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self
to use its Binary
implementation when Debug
-formatted.§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self
to use its Display
implementation when
Debug
-formatted.§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self
to use its LowerExp
implementation when
Debug
-formatted.§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self
to use its LowerHex
implementation when
Debug
-formatted.§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self
to use its Octal
implementation when Debug
-formatted.§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self
to use its Pointer
implementation when
Debug
-formatted.§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self
to use its UpperExp
implementation when
Debug
-formatted.§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self
to use its UpperHex
implementation when
Debug
-formatted.§fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
source§impl<Block, T> ForkBackend<Block> for T
impl<Block, T> ForkBackend<Block> for T
§impl<Block, T> HeaderProvider<Block> for Twhere
Block: Block,
T: HeaderBackend<Block> + 'static,
impl<Block, T> HeaderProvider<Block> for Twhere
Block: Block,
T: HeaderBackend<Block> + 'static,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more§impl<Src, Dest> IntoTuple<Dest> for Srcwhere
Dest: FromTuple<Src>,
impl<Src, Dest> IntoTuple<Dest> for Srcwhere
Dest: FromTuple<Src>,
fn into_tuple(self) -> Dest
source§impl<T, Outer> IsWrappedBy<Outer> for T
impl<T, Outer> IsWrappedBy<Outer> for T
source§impl<T, Outer> IsWrappedBy<Outer> for T
impl<T, Outer> IsWrappedBy<Outer> for T
§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read more§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read more§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self
, then passes self.as_ref()
into the pipe function.§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self
, then passes self.as_mut()
into the pipe
function.§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self
, then passes self.deref()
into the pipe function.§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<T> SaturatedConversion for T
impl<T> SaturatedConversion for T
source§fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
source§fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
T
. Read moresource§impl<T> SaturatedConversion for T
impl<T> SaturatedConversion for T
source§fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
source§fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
T
. Read more§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.§impl<T> Tap for T
impl<T> Tap for T
§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B>
of a value. Read more§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B>
of a value. Read more§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R>
view of a value. Read more§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R>
view of a value. Read more§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target
of a value. Read more§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target
of a value. Read more§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap()
only in debug builds, and is erased in release builds.§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut()
only in debug builds, and is erased in release
builds.§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow()
only in debug builds, and is erased in release
builds.§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut()
only in debug builds, and is erased in release
builds.§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref()
only in debug builds, and is erased in release
builds.§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut()
only in debug builds, and is erased in release
builds.§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref()
only in debug builds, and is erased in release
builds.§impl<T> TryConv for T
impl<T> TryConv for T
source§impl<T, U> TryIntoKey<U> for Twhere
U: TryFromKey<T>,
impl<T, U> TryIntoKey<U> for Twhere
U: TryFromKey<T>,
type Error = <U as TryFromKey<T>>::Error
fn try_into_key(self) -> Result<U, <U as TryFromKey<T>>::Error>
source§impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
source§fn unchecked_into(self) -> T
fn unchecked_into(self) -> T
unchecked_from
.source§impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
source§fn unchecked_into(self) -> T
fn unchecked_into(self) -> T
unchecked_from
.source§impl<T, S> UniqueSaturatedInto<T> for S
impl<T, S> UniqueSaturatedInto<T> for S
source§fn unique_saturated_into(self) -> T
fn unique_saturated_into(self) -> T
T
.source§impl<T, S> UniqueSaturatedInto<T> for S
impl<T, S> UniqueSaturatedInto<T> for S
source§fn unique_saturated_into(self) -> T
fn unique_saturated_into(self) -> T
T
.