https://github.com/paritytech/scale-typegen
https://github.com/paritytech/scale-typegen
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/paritytech/scale-typegen
- Owner: paritytech
- License: apache-2.0
- Created: 2023-11-07T18:03:07.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2025-03-17T04:42:52.000Z (about 1 year ago)
- Last Synced: 2025-04-09T10:49:03.267Z (about 1 year ago)
- Language: Rust
- Size: 499 KB
- Stars: 5
- Watchers: 4
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# scale-typegen
A library based on [scale-info](https://github.com/paritytech/scale-info) to transpile portable registries of types into rust type definitions.
This library exposes a `TypeGenerator` struct which wants to be given two things:
- a `scale_info::PortableRegistry` containing the type information for the types that will be transpiled.
- a `TypeGeneratorSettings` defining how the code generation happens: What derives and attributes that are applied, substitutes for types, if docs should be generated as well, (..).
It exposes a `generate_types_mod()` function that creates an intermediate representation of a module (`ModuleIR`) that contains types and other modules. It can be directly converted to rust code via `to_token_stream()`.