daml-codegen

Crates.iodaml-codegen
lib.rsdaml-codegen
version0.2.2
sourcesrc
created_at2022-03-01 09:29:48.922079
updated_at2022-03-08 08:38:51.413143
descriptionDaml GRPC Ledger API Code Generator
homepage
repositoryhttps://github.com/fujiapple852/rust-daml-bindings
max_upload_size
id541428
size98,863
FujiApple (fujiapple852)

documentation

README

Documentation Crate maintenance-status

Daml Codegen

A library and a tool for generating Rust types from daml code.

This crate provides:

  • A code generator backend for the of custom attributes and procedural macros defined in the daml-derive crate
  • A daml_codegen function which is designed to be used from build.rs files
  • A standalone codegen cli tool

Library

This crate should not be used directly when used as a library, instead you should depend on the daml crate and enable the codegen feature:

[dependencies]
daml = { version = "0.2.2", features = [ "codegen" ] }

Install

cargo install daml-codegen

Usage

USAGE:
    daml-codegen [OPTIONS] <dar>

ARGS:
    <dar>    Sets the input Dar file to use

OPTIONS:
    -c, --combine-modules              Combine modules as a single file
    -f, --module-filter <filter>...    Sets the regex module filter to apply
    -h, --help                         Print help information
    -i, --render-intermediate          Generate intermediate types
    -o, --output-dir <output>          Sets the output path
    -v, --verbose                      Sets the level of verbosity
    -V, --version                      Print version information

Example

To generate Rust types from Daml dar MyModel.dar in single src file /tmp/my_model_0_1_0.rs:

daml-codegen MyModel.dar --combine-modules -o /tmp/MyModel.dar

License

daml-codegen is distributed under the terms of the Apache License (Version 2.0).

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in time by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

See LICENSE for details.

Copyright 2022

Commit count: 328

cargo fmt