#proc-macro #codegen #ffi #dynamic #define

app dylo-cli

Generate dyn-compatible traits with proc macros

22 stable releases (3 major)

Uses new Rust 2024

4.7.0 Mar 22, 2025
4.6.0 Mar 22, 2025
3.0.1 Mar 21, 2025
2.2.0 Mar 4, 2025
1.0.4 Dec 6, 2024

#14 in Procedural macros

Download history 24/week @ 2024-12-11 19/week @ 2024-12-25 1/week @ 2025-01-08 4/week @ 2025-02-12 127/week @ 2025-02-19 586/week @ 2025-02-26 384/week @ 2025-03-05 1051/week @ 2025-03-19 72/week @ 2025-03-26

1,805 downloads per month

Apache-2.0 OR MIT

58KB
1.5K SLoC

license: MIT/Apache-2.0 crates.io docs.rs

dylo-cli

dylo-cli generates the consumer crates corresponding to module implementation crates marked with #[dylo::export] attributes. This tool scans the workspace for crates starting with mod- and generates corresponding consumer crates that contain just the trait definitions and public interfaces.

Installation

cargo install dylo-cli

Usage

The CLI expects to be run from the root of a Cargo workspace containing mod crates. It will:

  1. Find all crates prefixed with mod-
  2. Generate corresponding consumer crates with trait definitions
  3. Add spec files to the original mod crates
  4. Verify compilation of generated consumer crates

Basic usage:

dylo gen

Options:

  • --force: Force regeneration of all consumer crates
  • --mod <NAME>: Only process the specified mod
  • -h, --help: Print help information

By default, changes are only made if the source mod crates have been modified more recently than their generated consumer crates.

dylo annotations, exporting interfaces etc.

For how to write dylo-friendly code, see the documentation of the dylo crate

Dependencies

~4–11MB
~121K SLoC