18 releases (1 stable)
1.0.2 | Nov 5, 2024 |
---|---|
1.0.1-v1calls | Aug 5, 2024 |
0.2.4 | Mar 26, 2024 |
0.2.4-v1calls2 | Jun 3, 2024 |
0.1.0-alpha2 | Jan 24, 2024 |
#970 in Magic Beans
138 downloads per month
Used in 4 crates
(2 directly)
18KB
203 lines
Pendzl functionality and utils
The library is organized into three main components
1. Code Generation Module (codegen
)
This module contains the implementations of macros used for code generation in the library.
-
Contains:
- Implementation of the
codegen::implementation
macro:- Implements the
implementation
macro, which injects default fn implementations (& overrides) of standard traits.
- Implements the
- Boilerplate code for implementations injecting:
- Every implementation of a trait (PSP22, PSP34, PSP22Metadata etc) is injected with the default implementation of the trait.
- Implementation of the
codegen::storage_item
macro:- Implements functionality for the
storage_item
macro, handling storage-related code generation.
- Implements functionality for the
- Implementation of the
codegen::storage_field_getter_derive
macro:- Contains the implementation for deriving the
StorageFieldGetter
trait for storage structures.
- Contains the implementation for deriving the
- Implementation of the
See more about the code generation module here.
2. Macro Definitions Module (macro)
This module defines the public macros that are exposed to end users.
- Contains:
- Definition of the
implementation
macro:- Utilizes
codegen::implementation
internally to provide default implementations of standard traits.
- Utilizes
- Definition of the
storage_item
macro:- Uses
codegen::storage_item
to handle storage-related macros.
- Uses
- Definition of the
StorageFieldGetter
derive macro:- Employs
codegen::storage_field_getter_derive
to automatically derive getter methods for storage fields.
- Employs
- Definition of the
3. Source Module (src
)
This module serves as the main entry point and provides utility functions and re-exports for end users.
- Features:
- Re-exports the
macro
module:- Makes the macros defined in the
macro
module available to users.
- Makes the macros defined in the
- Contains mathematical utilities:
- Provides utility functions for mathematical operations used in the library.
- Includes various trait and type helpers:
- Contains helper traits and types to assist both the library and end users in developing smart contracts.
- Re-exports the
Dependencies
~8–12MB
~208K SLoC