ink_ir/
lib.rs

1// Copyright (C) Use Ink (UK) Ltd.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15//! The ink! intermediate representation (IR) and abstractions.
16//!
17//! This module defines everything the ink! procedural macro needs in order to
18//! parse, analyze and generate code for ink! smart contracts.
19//!
20//! The entry point for every ink! smart contract is the
21//! [`Contract`](`crate::ir::Contract`) with its [`Config`](`crate::ir::Config`) provided
22//! in the initial invocation at `#[ink::contract(... configuration ...)]`.
23//!
24//! The ink! IR tries to stay close to the original Rust syntactic structure.
25//! All ink! definitions of an ink! smart contract are always defined within
26//! a so-called Rust inline module (`mod my_module { ... items ... }`).
27//! Therefore all ink! definition are found and accessed using the
28//! [`ItemMod`](`crate::ir::ItemMod`) data structure.
29
30#![doc(
31    html_logo_url = "https://use.ink/img/crate-docs/logo.png",
32    html_favicon_url = "https://use.ink/crate-docs/favicon.png"
33)]
34
35#[macro_use]
36mod error;
37
38pub mod ast;
39mod ir;
40mod literal;
41
42pub use self::{
43    ir::{
44        blake2b_256,
45        marker,
46        utils,
47        Blake2x256Macro,
48        Callable,
49        CallableKind,
50        CallableWithSelector,
51        ChainExtension,
52        ChainExtensionMethod,
53        Config,
54        Constructor,
55        Contract,
56        Event,
57        ExtensionId,
58        ImplItem,
59        InkItem,
60        InkItemTrait,
61        InkTest,
62        InkTraitDefinition,
63        InkTraitItem,
64        InkTraitMessage,
65        InputsIter,
66        IsDocAttribute,
67        Item,
68        ItemImpl,
69        ItemMod,
70        IterConstructors,
71        IterEvents,
72        IterInkTraitItems,
73        IterItemImpls,
74        IterMessages,
75        Message,
76        Namespace,
77        Receiver,
78        Selector,
79        SelectorMacro,
80        SignatureTopicArg,
81        Storage,
82        StorageItem,
83        Visibility,
84    },
85    literal::HexLiteral,
86};