Trait BlockProducerMetadataRpcApiServer

Source
pub trait BlockProducerMetadataRpcApiServer<Metadata>:
    Sized
    + Send
    + Sync
    + 'static {
    // Required method
    fn get_block_producer_metadata(
        &self,
        cross_chain_public_key: CrossChainPublicKey,
    ) -> RpcResult<Option<Metadata>>;

    // Provided method
    fn into_rpc(self) -> RpcModule<Self>
       where Metadata: Send + Sync + 'static + Clone + Serialize { ... }
}
Expand description

Server trait implementation for the BlockProducerMetadataRpcApi RPC API.

Required Methods§

Source

fn get_block_producer_metadata( &self, cross_chain_public_key: CrossChainPublicKey, ) -> RpcResult<Option<Metadata>>

Returns JSON-encoded metadata for given cross_chain_public_key from the storage of the current tip if it exists.

Provided Methods§

Source

fn into_rpc(self) -> RpcModule<Self>
where Metadata: Send + Sync + 'static + Clone + Serialize,

Collects all the methods and subscriptions defined in the trait and adds them into a single RpcModule.

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<C, Block, Metadata: Decode + Sync + Send + 'static> BlockProducerMetadataRpcApiServer<Metadata> for BlockProducerMetadataRpc<C, Block, Metadata>
where Block: BlockT, C: Send + Sync + 'static + ProvideRuntimeApi<Block> + HeaderBackend<Block>, C::Api: BlockProducerMetadataApi<Block, Metadata>,