17 releases (10 breaking)

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

#267 in Rust patterns

Download history 38459/week @ 2024-10-27 54774/week @ 2024-11-03 42358/week @ 2024-11-10 39416/week @ 2024-11-17 40437/week @ 2024-11-24 33066/week @ 2024-12-01 42919/week @ 2024-12-08 31964/week @ 2024-12-15 9780/week @ 2024-12-22 16833/week @ 2024-12-29 32437/week @ 2025-01-05 48757/week @ 2025-01-12 44136/week @ 2025-01-19 36995/week @ 2025-01-26 41832/week @ 2025-02-02 44112/week @ 2025-02-09

168,842 downloads per month
Used in 59 crates (3 directly)

Apache-2.0

205KB
4.5K 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
~86K SLoC