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 = Entry<'_>>;

    // Provided method
    fn view_functions_in_pallet(
        &self,
        pallet: &str,
    ) -> impl Iterator<Item = Cow<'_, str>> { ... }
}
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 = Entry<'_>>

Iterate over all of the available View Functions.

Provided Methods§

Source

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

Iterate over all of the available View Functions 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 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 = Entry<'_>>

Source§

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

Implementors§