15 releases (8 breaking)

0.8.0 May 27, 2024
0.6.0 May 15, 2024
0.4.2 Mar 26, 2024
0.1.0 Dec 8, 2023
0.0.1 Nov 10, 2023

#352 in Rust patterns

Download history 1717/week @ 2024-03-24 2201/week @ 2024-03-31 3306/week @ 2024-04-07 3094/week @ 2024-04-14 2922/week @ 2024-04-21 2434/week @ 2024-04-28 2856/week @ 2024-05-05 2910/week @ 2024-05-12 2291/week @ 2024-05-19 2682/week @ 2024-05-26 3322/week @ 2024-06-02 2992/week @ 2024-06-09 3089/week @ 2024-06-16 3754/week @ 2024-06-23 3331/week @ 2024-06-30 3979/week @ 2024-07-07

14,271 downloads per month
Used in 31 crates (3 directly)

Apache-2.0

185KB
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

~3.5MB
~79K SLoC