11 releases (4 breaking)

0.4.3 Apr 2, 2024
0.4.2 Mar 26, 2024
0.3.1 Apr 2, 2024
0.3.0 Mar 20, 2024
0.0.1 Nov 10, 2023

#369 in Rust patterns

Download history 81/week @ 2024-01-05 106/week @ 2024-01-12 268/week @ 2024-01-19 426/week @ 2024-01-26 491/week @ 2024-02-02 732/week @ 2024-02-09 731/week @ 2024-02-16 907/week @ 2024-02-23 1890/week @ 2024-03-01 2192/week @ 2024-03-08 1980/week @ 2024-03-15 1958/week @ 2024-03-22 2008/week @ 2024-03-29 3175/week @ 2024-04-05 3027/week @ 2024-04-12 2063/week @ 2024-04-19

10,522 downloads per month
Used in 16 crates (3 directly)

Apache-2.0

175KB
4K SLoC

scale-typegen

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:

  • 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().


lib.rs:

A library based on scale-info to transpile portable registries of types into rust type definitions.

Dependencies

~4.5MB
~98K SLoC