Crate pro_lang_ir[][src]

The pro! intermediate representation (IR) and abstractions.

This module defines everything the pro! procedural macro needs in order to parse, analyze and generate code for pro! smart contracts.

The entry point for every pro! smart contract is the Contract with its Config provided in the initial invocation at #[pro::contract(... configuration ...)].

The pro! IR tries to stay close to the original Rust syntactic structure. All pro! definitions of an pro! smart contract are always defined within a so-called Rust inline modlue (mod my_module { ... items ... }). Therefore all pro! definition are found and accessed using the ItemMod data structure.

Macros

format_err

Creates a syn::Error with the format message and infers the Span using Spanned.

format_err_spanned

Creates a syn::Error with the format message and infers the Span using ToTokens.

Structs

CallableWithSelector

Wrapper for a callable that adds its composed selector.

ChainExtension

An pro! chain extension.

ChainExtensionMethod

An pro! chain extension method.

Config

The pro! configuration.

Constructor

An pro! constructor definition.

Contract

An pro! contract definition consisting of the pro! configuration and module.

Event

An pro! event struct definition.

ExtensionId

The unique ID of an pro! chain extension method.

InputsIter

Iterator over the input parameters of an pro! message or constructor.

ItemImpl

An pro! implementation block.

ItemMod

The pro! module.

IterConstructors

Iterator yielding all pro! constructor within a source pro! ir::ItemImpl.

IterEvents

Iterator yielding all pro! event definitions within the pro! ItemMod.

IterItemImpls

Iterator yielding all pro! implementation block definitions within the pro! ItemMod.

IterMessages

Iterator yielding all pro! messages within a source pro! ir::ItemImpl.

IterProTraitItems

Iterator over all the pro! trait items of an pro! trait definition.

Message

An pro! message definition.

Namespace

An pro! namespace applicable to a trait implementation block.

ProTest

The pro! test with all required information.

ProTrait

A checked pro! trait definition.

ProTraitConstructor

A checked pro! constructor of an pro! trait definition.

ProTraitMessage

A checked pro! message of an pro! trait definition.

Selector

A function selector.

Storage

An pro! storage struct definition.

Enums

CallableKind

The kind of externally callable smart contract entity.

ImplItem

An item within an pro! implementation block.

Item

An item in the root of the pro! module (ir::ItemMod).

ProItem

An pro! specific item.

ProTraitItem

An pro! item within an pro! trait definition.

Receiver

The receiver of an pro! message.

Visibility

The visibility of an pro! message or constructor.

Traits

Callable

An pro! callable.