18 releases

new 0.1.37 Dec 21, 2024
0.1.36 Nov 12, 2024
0.1.27 Oct 31, 2024

#100 in Procedural macros

Download history 1698/week @ 2024-10-24 1389/week @ 2024-10-31 358/week @ 2024-11-07 109/week @ 2024-11-14 96/week @ 2024-11-21 19/week @ 2024-11-28 18/week @ 2024-12-05 11/week @ 2024-12-12

166 downloads per month
Used in 4 crates

Apache-2.0

1.5MB
25K SLoC

rusteron-code-gen

rusteron-code-gen is a module in the rusteron project that is responsible for generating Rust code by analyzing the Aeron C bindings. It plays a crucial role in automating the generation of the Rust wrappers that make it possible for developers to interact with the Aeron APIs in an idiomatic Rust way.

Overview

The rusteron-code-gen module is an internal tool used to generate Rust code based on Aeron's C bindings. Aeron follows certain patterns in its API, and rusteron-code-gen takes advantage of these predictable structures to automate much of the code generation process. By automating the conversion of C bindings to Rust, rusteron-code-gen helps reduce the time and effort required for maintaining and updating the Rust interface as the Aeron API evolves.

This module is used internally within the rusteron project and is not intended for direct use by developers integrating Aeron functionalities into their projects.

Features

  • Automated Code Generation: Generates Rust wrappers for the Aeron C bindings.
  • Pattern-Based Conversion: Leverages Aeron's consistent API patterns to simplify Rust code generation.

Project Status

rusteron-code-gen is in active use for generating and maintaining the Rust wrappers for other rusteron modules, such as rusteron-client and rusteron-archive. As the primary focus is on the client and archive modules, rusteron-code-gen does not have its own extensive testing beyond ensuring the generated code integrates smoothly into the rest of the rusteron project.

Installation

rusteron-code-gen is used internally and is not intended to be added directly to other projects.

Safety Considerations

Since rusteron-code-gen operates on C bindings, the generated code can include unsafe blocks to ensure compatibility with the low-level Aeron API. The automated process requires careful review and occasional manual intervention to ensure safety and correctness.

Contributing

Contributions are more than welcome! Please see our contributing guidelines for more information on how to get involved. Improvements to rusteron-code-gen could significantly enhance the automation and reliability of the Rust code generation process.

License

This project is dual-licensed under either the MIT License or Apache License 2.0. You may choose which one to use.

Feel free to reach out with any questions or suggestions via GitHub Issues!

Dependencies

~2.7–4MB
~78K SLoC