referrerpolicy=no-referrer-when-downgrade

Trait polkadot_sdk_frame::runtime::apis::Metadata

pub trait Metadata<Block>: Core<Block>
where Block: Block,
{ // Provided methods fn metadata( &self, __runtime_api_at_param__: <Block as Block>::Hash, ) -> Result<OpaqueMetadata, ApiError> { ... } fn metadata_at_version( &self, __runtime_api_at_param__: <Block as Block>::Hash, version: u32, ) -> Result<Option<OpaqueMetadata>, ApiError> { ... } fn metadata_versions( &self, __runtime_api_at_param__: <Block as Block>::Hash, ) -> Result<Vec<u32>, ApiError> { ... } }
Expand description

The Metadata api trait that returns metadata for the runtime.

Provided Methods§

fn metadata( &self, __runtime_api_at_param__: <Block as Block>::Hash, ) -> Result<OpaqueMetadata, ApiError>

Returns the metadata of a runtime.

fn metadata_at_version( &self, __runtime_api_at_param__: <Block as Block>::Hash, version: u32, ) -> Result<Option<OpaqueMetadata>, ApiError>

Returns the metadata at a given version.

If the given version isn’t supported, this will return None. Use Self::metadata_versions to find out about supported metadata version of the runtime.

fn metadata_versions( &self, __runtime_api_at_param__: <Block as Block>::Hash, ) -> Result<Vec<u32>, ApiError>

Returns the supported metadata versions.

This can be used to call metadata_at_version.

Trait Implementations§

§

impl<Block> RuntimeApiInfo for dyn Metadata<Block>
where Block: Block,

§

const ID: [u8; 8] = _

The identifier of the runtime api.
§

const VERSION: u32 = 2u32

The version of the runtime api.

Implementors§