Holium Rust SDK is a tool used to compile Rust code to proper Holium transformations. It leverages procedural macro to do so.
The project is divided in 4 main parts.
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.
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.
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.
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.
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
}
Contributions, issues and feature requests are welcome!
Feel free to check the dedicated section in the documentation.
Give a βοΈ if this project helped you and use the official badge to link to the project!
This project is MIT licensed.
This README was generated with β€οΈ by readme-md-generator