4 releases (1 stable)
1.0.0 | Nov 17, 2021 |
---|---|
1.0.0-alpha.1 | Nov 13, 2021 |
#1866 in Data structures
22KB
436 lines
Welcome to Holium Rust SDK 👋
Holium Rust SDK is a tool used to compile Rust code to proper Holium transformations. It leverages procedural macro to do so.
🏠 Homepage
🗂 Content
The project is divided in 4 main parts.
Holium Rust SDK
Located in ./crates/sdk
, the Holium Rust SDK is the crate that exposes the procedural macro to the rust code. It is also in
charge of exposing internal dependencies to ensure that the generated code works.
Macro
Located in ./crates/macro
, the macro crate is a proc-macro
crate that implements the procedural macro
used for compilation of transformations in the Holium Framework.
It is also in this crate that our tests on the procedural macro are conducted. Know more about our testing method here.
Macro Support
Located in ./crates/macro-support
, the macro support crate is in charge of parsing Item
objects that
are fetched by the procedural macro. This allows to convert the different elements to structures that
can be manipulated in the backend.
Backend
Located in ./crates/backend
, the backend crate contains all the logical sequence that generates necessary code for a
transformation to run inside a Holium runtime.
📝 Usage
Be sure to check the official documentation to know better how to use the Holium Rust SDK, with practical examples.
The Holium Rust SDK has to be used as a procedural macro. Here is an example of how it is used in source code.
use holium_rs_sdk::holium_bindgen;
#[holium_bindgen]
pub struct Values {
pub a: u32,
pub b: u32
}
#[holium_bindgen]
pub fn main(values: Values) -> u32 {
values.a + values.b
}
🤝 Contributing
Contributions, issues and feature requests are welcome!
Feel free to check the dedicated section in the documentation.
🙋 Show your support
Give a ⭐️ if this project helped you and use the official badge to link to the project!
📝 License
This project is MIT licensed.
This README was generated with ❤️ by readme-md-generator
Dependencies
~1–1.6MB
~35K SLoC