Module frame_support::dispatch

source ·
Expand description

Dispatch system. Contains a macro for defining runtime modules and generating values representing lazy module function calls.

Re-exports

Modules

  • Utilities for formatting and printing Strings.
  • Primitive traits and types representing basic properties of types.
  • Error handling with the Result type.

Structs

  • A bundle of static information collected from the #[pallet::weight] attributes.
  • A struct holding value for each DispatchClass.
  • Weight information that is only available post dispatch. NOTE: This can only be used to reduce the weight or fee, not increase it.
  • A contiguous growable array type, written as Vec<T>, short for ‘vector’.

Enums

  • A generalized group of dispatch types.
  • Reason why a dispatch call failed.
  • Explicit enum to denote if a transaction pays fee or not.
  • Origin for the System pallet.

Traits

  • Serializable version of pallet dispatchable.
  • Means of classifying a dispatchable function.
  • A common trait for the ability to explicitly duplicate an object.
  • Trait that allows zero-copy read/write of value-references to/from slices in LE format.
  • Trait that allows zero-copy read of value-references from slices in LE format.
  • A lazy call (module function and argument values) that can be executed via its dispatch method.
  • Trait that allows zero-copy write of value-references to slices in LE format.
  • Something that can be encoded as a reference.
  • A marker trait that tells the compiler that a type encode to the same representation as another type.
  • Trait for equality comparisons which are equivalence relations.
  • A Dispatchable function (aka transaction) that can carry some static information along with it, using the #[pallet::weight] attribute.
  • Trait that tells you if a given type can be encoded/decoded in a compact way.
  • Trait that allows reading of data into a slice.
  • Items implementing MaxEncodedLen have a statically known maximum encoded size.
  • A trait that represents one or many values of given type.
  • Trait that allows writing of data.
  • A type that can be used as a parameter in a dispatchable function.
  • Trait for equality comparisons.
  • Indicates if dispatch function should pay fees or not.
  • Implementors return their meta type information.
  • Means of weighing some particular kind of data (T).
  • Allows easy conversion from DispatchError to DispatchErrorWithPostInfo for dispatchables that want to return a custom a posterior weight on error.

Functions

  • Extract the actual pays_fee from a dispatch result if any or fall back to the default weight.
  • Extract the actual weight from a dispatch result if any or fall back to the default weight.

Type Definitions

  • The error type contained in a DispatchResultWithPostInfo.
  • Unaugmented version of DispatchResultWithPostInfo that can be returned from dispatchable functions and is automatically converted to the augmented type. Should be used whenever the PostDispatchInfo does not need to be overwritten. As this should be the common case it is the implicit return type when none is specified.
  • The return type of a Dispatchable in frame. When returned explicitly from a dispatchable function it allows overriding the default PostDispatchInfo returned from a dispatch.
  • Priority for a transaction. Additive. Higher is better.

Derive Macros

  • Derive macro generating an impl of the trait Clone.
  • Derive parity_scale_codec::Decode and for struct and enum.
  • Derive parity_scale_codec::Encode and parity_scale_codec::EncodeLike for struct and enum.
  • Derive macro generating an impl of the trait Eq.
  • Derive parity_scale_codec::MaxEncodedLen for struct and enum.
  • Derive macro generating an impl of the trait PartialEq. The behavior of this macro is described in detail here.