scale-typegen

Crates.ioscale-typegen
lib.rsscale-typegen
version0.10.0
sourcesrc
created_at2023-11-10 16:47:00.950123
updated_at2024-11-15 15:48:05.065619
descriptionType Generation for SCALE encoded Rust Types
homepage
repositoryhttps://github.com/paritytech/scale-typegen
max_upload_size
id1031328
size214,004
Core devs (github:paritytech:core-devs)

documentation

README

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

Commit count: 62

cargo fmt