Crate agsol_borsh_schema[][src]

Expand description

This library aims to facilitate the workflow between Rust and TypeScript data structures by auto-generating ! TypeScript classes and respective serialization layouts used for Borsh (de)serialization. Check out borsh-js and borsh-rs for more details.

By default the library provides a derivable trait BorshSchema without any associated methods and constants. It’s an empty trait that is essentially a flag for the schema parser that works the following way:

  1. the parser traverses all .rs files in the provided input directory

  2. data structures (structs and enums) annotated with #[derive(BorshSchema, ...)] are parsed into an intermediate data structure

  3. the intermediate data structure is used to generate output files containing TypeScript classes and serialization schemas

The parser itself is only available through the full feature flag, because it uses parsing libraries incompatible with wasm or bpf targets.

Traits

An empty trait that serves as a flag for the schema parser.

Derive Macros