#codegen #proc-macro #dynamic #ffi #cargo-workspace

app dylo-cli

Generate dyn-compatible traits with proc macros

13 stable releases

new 3.0.0 Mar 4, 2025
2.2.0 Mar 4, 2025
1.0.7 Mar 1, 2025
1.0.6 Feb 28, 2025
1.0.4 Dec 6, 2024

#13 in Procedural macros

Download history 254/week @ 2024-11-30 141/week @ 2024-12-07 8/week @ 2024-12-14 5/week @ 2024-12-21 14/week @ 2024-12-28 1/week @ 2025-01-11 4/week @ 2025-02-15 205/week @ 2025-02-22 762/week @ 2025-03-01

971 downloads per month

Apache-2.0 OR MIT

56KB
1K SLoC

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

dylo-runtime

dylo-runtime 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 con- crates that contain just the trait definitions and public interfaces.

Installation

cargo install dylo-runtime

Note that dylo-runtime needs rustfmt to be present at runtime.

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 con- crates with trait definitions
  3. Add spec files to the original mod crates
  4. Verify compilation of generated consumer crates

Basic usage:

con

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.

con annotations, exporting interfaces etc.

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

Dependencies

~4–11MB
~120K SLoC