#账本 #daaml #API

bin+lib daml-codegen

Daml GRPC 账本 API 代码生成器

5 个版本

0.2.2 2022年3月8日
0.2.1 2022年3月7日
0.2.0 2022年3月4日
0.1.1 2022年3月3日
0.1.0 2022年3月1日

#2340 in 开发工具


用于 2 crates

Apache-2.0

3MB
11K SLoC

Documentation Crate maintenance-status

daaml Codegen

一个用于从 daml 代码生成 Rust 类型的库和工具。

此包提供

  • daml-derive 包中定义的自定义属性和过程宏提供的代码生成后端
  • 一个 daml_codegen 函数,该函数设计用于在 build.rs 文件中使用
  • 独立的代码生成 CLI 工具

当用作库时,不应直接使用此包,而应依赖于 daml 包并启用 codegen 功能

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

安装

cargo install daml-codegen

用法

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

示例

从单个源文件 /tmp/my_model_0_1_0.rs 生成从 Daml dar MyModel.dar 中的 Rust 类型

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

许可协议

daml-codegen 在 Apache 许可协议(版本 2.0)的条款下分发。

除非您明确表示,否则任何有意提交以供包含在 Apache-2.0 许可协议中定义的时间内的贡献,将按上述方式双许可,而无需任何附加条款或条件。

有关详细信息,请参阅 LICENSE

版权所有 2022

依赖项

~6.5–9.5MB
~171K SLoC