referrerpolicy=no-referrer-when-downgrade

Trait polkadot_sdk_frame::traits::Dispatchable

pub trait Dispatchable {
    type RuntimeOrigin: Debug;
    type Config;
    type Info;
    type PostInfo: Eq + PartialEq + Clone + Copy + Encode + Decode + Printable + ExtensionPostDispatchWeightHandler<Self::Info>;

    // Required method
    fn dispatch(
        self,
        origin: Self::RuntimeOrigin,
    ) -> Result<Self::PostInfo, DispatchErrorWithPostInfo<Self::PostInfo>>;
}
Expand description

A lazy call (module function and argument values) that can be executed via its dispatch method.

Required Associated Types§

type RuntimeOrigin: Debug

Every function call from your runtime has an origin, which specifies where the extrinsic was generated from. In the case of a signed extrinsic (transaction), the origin contains an identifier for the caller. The origin can be empty in the case of an inherent extrinsic.

type Config

type Info

An opaque set of information attached to the transaction. This could be constructed anywhere down the line in a runtime. The current Substrate runtime uses a struct with the same name to represent the dispatch class and weight.

type PostInfo: Eq + PartialEq + Clone + Copy + Encode + Decode + Printable + ExtensionPostDispatchWeightHandler<Self::Info>

Additional information that is returned by dispatch. Can be used to supply the caller with information about a Dispatchable that is only known post dispatch.

Required Methods§

fn dispatch( self, origin: Self::RuntimeOrigin, ) -> Result<Self::PostInfo, DispatchErrorWithPostInfo<Self::PostInfo>>

Actually dispatch this call and return the result of it.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

§

impl Dispatchable for ()

§

type RuntimeOrigin = ()

§

type Config = ()

§

type Info = ()

§

type PostInfo = ()

§

fn dispatch( self, _origin: <() as Dispatchable>::RuntimeOrigin, ) -> Result<<() as Dispatchable>::PostInfo, DispatchErrorWithPostInfo<<() as Dispatchable>::PostInfo>>

Implementors§

§

impl Dispatchable for MockCallU64

§

type RuntimeOrigin = u64

§

type Config = ()

§

type Info = ()

§

type PostInfo = ()

§

impl<Inner> Dispatchable for FakeDispatchable<Inner>

§

type RuntimeOrigin = ()

§

type Config = ()

§

type Info = ()

§

type PostInfo = ()