Trait sp_api::Metadata

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

The Metadata api trait that returns metadata for the runtime.

Provided Methods§

source

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

Returns the metadata of a runtime.

source

fn metadata_at_version( &self, __runtime_api_at_param__: <Block as BlockT>::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.

source

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

Returns the supported metadata versions.

This can be used to call metadata_at_version.

Trait Implementations§

source§

impl<Block: BlockT> RuntimeApiInfo for dyn Metadata<Block>

source§

const ID: [u8; 8] = _

The identifier of the runtime api.
source§

const VERSION: u32 = 2u32

The version of the runtime api.

Implementors§