Crates.io | ink-analyzer-macro |
lib.rs | ink-analyzer-macro |
version | 0.7.2 |
source | src |
created_at | 2023-04-14 05:42:05.704477 |
updated_at | 2024-02-04 16:13:59.177571 |
description | Procedural macros for ink! analyzer. |
homepage | https://github.com/ink-analyzer/ink-analyzer |
repository | https://github.com/ink-analyzer/ink-analyzer |
max_upload_size | |
id | 838950 |
size | 29,008 |
Procedural macros for ink-analyzer and ink-analyzer-ir.
This library implements procedural macros used primarily by the ink-analyzer-ir crate.
Run the following Cargo command in your project directory
cargo add ink-analyzer-macro
Using ink_analyzer_macro::entity
proc-macro to create a Contract
type.
use ink_analyzer_ir::{Event, Message, Storage};
use ink_analyzer_ir::ast;
#[ink_analyzer_macro::entity(macro_kind = Contract)]
#[derive(Debug, Clone, PartialEq, Eq)]
struct Contract {
ast: ast::Module,
storage: Option<Storage>,
events: Vec<Event>,
#[initializer(call = ink_analyzer_ir::ink_callable_closest_descendants)]
messages: Vec<Message>,
// --snip--
}
https://docs.rs/ink-analyzer-macro/latest/ink_analyzer_macro/
Or you can access documentation locally by running the following command from the project root
cargo doc -p ink-analyzer-macro --open
You can run unit tests for all the core functionality by running the following command from the project root
cargo test -p ink-analyzer-macro
Licensed under either MIT or Apache-2.0 license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.