14 releases (7 breaking)

new 0.7.0 May 15, 2024
0.5.0 Apr 29, 2024
0.4.2 Mar 26, 2024
0.1.0 Dec 8, 2023
0.0.1 Nov 10, 2023

#405 in Rust patterns

Download history 496/week @ 2024-01-24 411/week @ 2024-01-31 698/week @ 2024-02-07 784/week @ 2024-02-14 744/week @ 2024-02-21 1431/week @ 2024-02-28 2186/week @ 2024-03-06 1884/week @ 2024-03-13 2353/week @ 2024-03-20 1540/week @ 2024-03-27 2641/week @ 2024-04-03 3533/week @ 2024-04-10 2596/week @ 2024-04-17 3173/week @ 2024-04-24 2326/week @ 2024-05-01 2305/week @ 2024-05-08

11,020 downloads per month
Used in 22 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

~4MB
~81K SLoC