ViewFunctionTypeInfo

Trait ViewFunctionTypeInfo 

Source
pub trait ViewFunctionTypeInfo {
    type TypeId: Clone;

    // Required methods
    fn view_function_info(
        &self,
        pallet_name: &str,
        function_name: &str,
    ) -> Result<ViewFunctionInfo<'_, Self::TypeId>, ViewFunctionInfoError<'_>>;
    fn view_functions(&self) -> impl Iterator<Item = ViewFunction<'_>>;
}
Expand description

This is implemented for anything capable of providing information about view functions (primarily metadata V16 and onwards).

Required Associated Types§

Source

type TypeId: Clone

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

Required Methods§

Source

fn view_function_info( &self, pallet_name: &str, function_name: &str, ) -> Result<ViewFunctionInfo<'_, Self::TypeId>, ViewFunctionInfoError<'_>>

Get the information needed to decode a specific View Function.

Source

fn view_functions(&self) -> impl Iterator<Item = ViewFunction<'_>>

Iterate over all of the available View Functions.

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 ViewFunctionTypeInfo for RuntimeMetadataV16

Source§

type TypeId = u32

Source§

fn view_function_info( &self, pallet_name: &str, function_name: &str, ) -> Result<ViewFunctionInfo<'_, Self::TypeId>, ViewFunctionInfoError<'_>>

Source§

fn view_functions(&self) -> impl Iterator<Item = ViewFunction<'_>>

Implementors§