RuntimeApiTypeInfo

Trait RuntimeApiTypeInfo 

Source
pub trait RuntimeApiTypeInfo {
    type TypeId: Clone;

    // Required methods
    fn runtime_api_info(
        &self,
        trait_name: &str,
        method_name: &str,
    ) -> Result<RuntimeApiInfo<'_, Self::TypeId>, RuntimeApiInfoError<'_>>;
    fn runtime_apis(&self) -> impl Iterator<Item = Entry<'_>>;

    // Provided method
    fn runtime_apis_in_trait(
        &self,
        trait_name: &str,
    ) -> impl Iterator<Item = Cow<'_, str>> { ... }
}
Expand description

This can be implemented for anything capable of providing Runtime API type information. It is implemented for newer versions of frame-metadata (V15 and above).

Required Associated Types§

Source

type TypeId: Clone

The type of type IDs that we are using to obtain type information.

Required Methods§

Source

fn runtime_api_info( &self, trait_name: &str, method_name: &str, ) -> Result<RuntimeApiInfo<'_, Self::TypeId>, RuntimeApiInfoError<'_>>

Get the information needed to encode/decode a specific Runtime API call

Source

fn runtime_apis(&self) -> impl Iterator<Item = Entry<'_>>

Iterate over all of the available Runtime APIs.

Provided Methods§

Source

fn runtime_apis_in_trait( &self, trait_name: &str, ) -> impl Iterator<Item = Cow<'_, str>>

Iterate over all of the available Runtime APIs in a given trait.

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.

Implementations on Foreign Types§

Source§

impl RuntimeApiTypeInfo for RuntimeMetadataV15

Source§

type TypeId = u32

Source§

fn runtime_api_info( &self, trait_name: &str, method_name: &str, ) -> Result<RuntimeApiInfo<'_, Self::TypeId>, RuntimeApiInfoError<'_>>

Source§

fn runtime_apis(&self) -> impl Iterator<Item = Entry<'_>>

Source§

fn runtime_apis_in_trait( &self, trait_name: &str, ) -> impl Iterator<Item = Cow<'_, str>>

Source§

impl RuntimeApiTypeInfo for RuntimeMetadataV16

Source§

type TypeId = u32

Source§

fn runtime_api_info( &self, trait_name: &str, method_name: &str, ) -> Result<RuntimeApiInfo<'_, Self::TypeId>, RuntimeApiInfoError<'_>>

Source§

fn runtime_apis(&self) -> impl Iterator<Item = Entry<'_>>

Source§

fn runtime_apis_in_trait( &self, trait_name: &str, ) -> impl Iterator<Item = Cow<'_, str>>

Source§

impl RuntimeApiTypeInfo for TypeRegistry

Source§

type TypeId = LookupName

Source§

fn runtime_api_info( &self, trait_name: &str, method_name: &str, ) -> Result<RuntimeApiInfo<'_, Self::TypeId>, RuntimeApiInfoError<'_>>

Source§

fn runtime_apis(&self) -> impl Iterator<Item = Entry<'_>>

Source§

fn runtime_apis_in_trait( &self, trait_name: &str, ) -> impl Iterator<Item = Cow<'_, str>>

Source§

impl<'a> RuntimeApiTypeInfo for TypeRegistrySet<'a>

Source§

type TypeId = LookupName

Source§

fn runtime_api_info( &self, trait_name: &str, method_name: &str, ) -> Result<RuntimeApiInfo<'_, Self::TypeId>, RuntimeApiInfoError<'_>>

Source§

fn runtime_apis(&self) -> impl Iterator<Item = Entry<'_>>

Source§

fn runtime_apis_in_trait( &self, trait_name: &str, ) -> impl Iterator<Item = Cow<'_, str>>

Implementors§