Crate fabric_support[][src]

Support code for the runtime.

Re-exports

pub use serde;
pub use self::storage::StorageValue;
pub use self::storage::StorageMap;
pub use self::storage::StorageDoubleMap;
pub use self::storage::StoragePrefixedMap;
pub use self::storage::IterableStorageMap;
pub use self::storage::IterableStorageDoubleMap;
pub use self::storage::migration;
pub use self::dispatch::Parameter;
pub use self::dispatch::Callable;
pub use tp_runtime;

Modules

debug

Runtime debugging and logging utilities.

dispatch

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

error

Macro for declaring a module error.

event

Macros that define an Event types. Events can be used to easily report changes or conditions in your runtime to external entities like users, chain explorers, or dApps.

genesis_config

Macros for generating the runtime genesis config.

inherent
instances

Some instance placeholder to be used in fabric_support::noble attribute macro.

metadata
noble_prelude

Prelude to be used alongside noble macro, for ease of use.

storage

Stuff to do with the runtime’s storage.

traits

Traits for FABRIC.

unsigned
weights

Primitives for transaction weighting.

Macros

__impl_outer_config_types

Helper macro for impl_outer_config

assert_err

Assert an expression returns an error specified.

assert_err_ignore_postinfo

Assert an expression returns an error specified.

assert_err_with_weight

Assert an expression returns error with the given weight.

assert_noop

Evaluate an expression, assert it returns an expected Err value and that runtime storage has not been mutated (i.e. expression is a no-operation).

assert_ok

Panic if an expression doesn’t evaluate to Ok.

assert_storage_noop

Evaluate any expression and assert that runtime storage has not been mutated (i.e. expression is a storage no-operation).

construct_runtime

Construct a runtime, with the given name and the given modules.

crate_to_noble_version

Convert the current crate version into a NobleVersion.

decl_error

Declare an error type for a runtime module.

decl_event

Implement the Event for a module.

decl_module

Declares a Module struct and a Call enum, which implements the dispatch logic.

decl_storage

Declares strongly-typed wrappers around codec-compatible types in storage.

ensure

Evaluate $x:expr and if not true return Err($y:expr).

fail

Return Err of the expression: return Err($expression);.

impl_filter_stack
impl_outer_config

Implement the runtime genesis configuration.

impl_outer_dispatch

Implement a meta-dispatch module to dispatch to other dispatchers.

impl_outer_event

Constructs an Event type for a runtime. This is usually called automatically by the construct_runtime macro.

impl_outer_inherent

Implement the outer inherent. All given modules need to implement ProvideInherent.

impl_outer_origin

Constructs an Origin type for a runtime. This is usually called automatically by the construct_runtime macro. See also __create_decl_macro.

impl_outer_validate_unsigned

Implement ValidateUnsigned for Runtime. All given modules need to implement ValidateUnsigned.

impl_runtime_metadata

Implements the metadata support for the given runtime and all its modules.

ord_parameter_types

Macro for easily creating a new implementation of both the Get and Contains traits. Use exactly as with parameter_types, only the type must be Ord.

parameter_types

Create new implementations of the Get trait.

parameter_types_impl_thread_local
runtime_print

Print out a formatted message.

Structs

Blake2_128

Hash storage keys with blake2 128

Blake2_128Concat

Hash storage keys with concat(blake2_128(key), key)

Blake2_256

Hash storage keys with blake2 256

Identity

Store the key directly.

Twox64Concat

Hash storage keys with concat(twox64(key), key)

Twox128

Hash storage keys with twox 128

Twox256

Hash storage keys with twox 256

Enums

Never

A type that cannot be instantiated.

Void

The void type - it cannot exist.

Traits

Hashable
Printable

Trait for things which can be printed from the runtime.

ReversibleStorageHasher

Hasher to use to hash keys to insert to storage.

StorageHasher

Hasher to use to hash keys to insert to storage.

Functions

print

Print something that implements Printable from the runtime.

Type Definitions

ConsensusEngineId

Consensus engine unique ID.

Attribute Macros

noble

noble attribute macro allows to define a noble to be used in construct_runtime!.

require_transactional

Assert the annotated function is executed within a storage transaction.

transactional

Execute the annotated function in a new storage transaction.

Derive Macros

CloneNoBound

Derive Clone but do not bound any generic.

DebugNoBound

Derive Debug but do not bound any generic.

EqNoBound

Derive Eq but do not bound any generic.

PartialEqNoBound

Derive PartialEq but do not bound any generic.

RuntimeDebugNoBound

Derive Debug, if std is enabled it uses fabric_support::DebugNoBound, if std is not enabled it just returns "<stripped>". This behaviour is useful to prevent bloating the runtime WASM blob from unneeded code.