ConstantTypeInfo

Trait ConstantTypeInfo 

Source
pub trait ConstantTypeInfo {
    type TypeId: Clone;

    // Required methods
    fn constant_info(
        &self,
        pallet_name: &str,
        constant_name: &str,
    ) -> Result<ConstantInfo<'_, Self::TypeId>, ConstantInfoError<'_>>;
    fn constants(&self) -> impl Iterator<Item = Entry<'_>>;

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

This can be implemented for anything capable of providing Constant information.

Required Associated Types§

Source

type TypeId: Clone

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

Required Methods§

Source

fn constant_info( &self, pallet_name: &str, constant_name: &str, ) -> Result<ConstantInfo<'_, Self::TypeId>, ConstantInfoError<'_>>

Get information about a constant

Source

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

Iterate over all of the available Constants.

Provided Methods§

Source

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

Iterate over all of the available constants in a given pallet.

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 ConstantTypeInfo for RuntimeMetadataV8

Source§

type TypeId = LookupName

Source§

fn constant_info( &self, pallet_name: &str, constant_name: &str, ) -> Result<ConstantInfo<'_, Self::TypeId>, ConstantInfoError<'_>>

Source§

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

Source§

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

Source§

impl ConstantTypeInfo for RuntimeMetadataV9

Source§

type TypeId = LookupName

Source§

fn constant_info( &self, pallet_name: &str, constant_name: &str, ) -> Result<ConstantInfo<'_, Self::TypeId>, ConstantInfoError<'_>>

Source§

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

Source§

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

Source§

impl ConstantTypeInfo for RuntimeMetadataV10

Source§

type TypeId = LookupName

Source§

fn constant_info( &self, pallet_name: &str, constant_name: &str, ) -> Result<ConstantInfo<'_, Self::TypeId>, ConstantInfoError<'_>>

Source§

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

Source§

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

Source§

impl ConstantTypeInfo for RuntimeMetadataV11

Source§

type TypeId = LookupName

Source§

fn constant_info( &self, pallet_name: &str, constant_name: &str, ) -> Result<ConstantInfo<'_, Self::TypeId>, ConstantInfoError<'_>>

Source§

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

Source§

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

Source§

impl ConstantTypeInfo for RuntimeMetadataV12

Source§

type TypeId = LookupName

Source§

fn constant_info( &self, pallet_name: &str, constant_name: &str, ) -> Result<ConstantInfo<'_, Self::TypeId>, ConstantInfoError<'_>>

Source§

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

Source§

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

Source§

impl ConstantTypeInfo for RuntimeMetadataV13

Source§

type TypeId = LookupName

Source§

fn constant_info( &self, pallet_name: &str, constant_name: &str, ) -> Result<ConstantInfo<'_, Self::TypeId>, ConstantInfoError<'_>>

Source§

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

Source§

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

Source§

impl ConstantTypeInfo for RuntimeMetadataV14

Source§

type TypeId = u32

Source§

fn constant_info( &self, pallet_name: &str, constant_name: &str, ) -> Result<ConstantInfo<'_, Self::TypeId>, ConstantInfoError<'_>>

Source§

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

Source§

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

Source§

impl ConstantTypeInfo for RuntimeMetadataV15

Source§

type TypeId = u32

Source§

fn constant_info( &self, pallet_name: &str, constant_name: &str, ) -> Result<ConstantInfo<'_, Self::TypeId>, ConstantInfoError<'_>>

Source§

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

Source§

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

Source§

impl ConstantTypeInfo for RuntimeMetadataV16

Source§

type TypeId = u32

Source§

fn constant_info( &self, pallet_name: &str, constant_name: &str, ) -> Result<ConstantInfo<'_, Self::TypeId>, ConstantInfoError<'_>>

Source§

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

Source§

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

Implementors§