Crates.io | scale-typegen |
lib.rs | scale-typegen |
version | 0.10.0 |
source | src |
created_at | 2023-11-10 16:47:00.950123 |
updated_at | 2024-11-15 15:48:05.065619 |
description | Type Generation for SCALE encoded Rust Types |
homepage | |
repository | https://github.com/paritytech/scale-typegen |
max_upload_size | |
id | 1031328 |
size | 214,004 |
A library based on 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:
scale_info::PortableRegistry
containing the type information for the types that will be transpiled.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()
.