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 Blake2x256Macro,
45 Callable,
46 CallableKind,
47 CallableWithSelector,
48 Config,
49 Constructor,
50 Contract,
51 Event,
52 EventConfig,
53 ImplItem,
54 InkItem,
55 InkItemTrait,
56 InkTest,
57 InkTraitDefinition,
58 InkTraitItem,
59 InkTraitMessage,
60 InputsIter,
61 IsDocAttribute,
62 Item,
63 ItemImpl,
64 ItemMod,
65 IterConstructors,
66 IterEvents,
67 IterInkTraitItems,
68 IterItemImpls,
69 IterMessages,
70 Message,
71 Namespace,
72 Receiver,
73 Selector,
74 SelectorMacro,
75 SignatureTopic,
76 Storage,
77 StorageItem,
78 Visibility,
79 blake2b_256,
80 marker,
81 utils,
82 },
83 literal::HexLiteral,
84};