Macros

Crates.io Docs.rs MIT licensed Audit Clippy Tests

🤔 Why?

Write custom types with near-zero boilerplate code. Rust is great, but when you write a lot of custom types, adding constructor and getters becomes tedious. These macros solve this by generating the boilerplate code for you.

🎁 Features

🚀 Install

Just run:

bash cargo add deep_causality_macros

⭐ Usage

See:

```rust use deepcausalitymacros::{Getters, Constructor};

[derive(Getters, Constructor, Debug, Copy, Clone, Hash, Eq, PartialEq)]

pub struct Data{ #[getter(name = data_id)] // Rename getter methods as you wish id: u64, data: T, filled: bool, }

pub fn main() { let d = Data::new(0, 42, true); asserteq!(*d.dataid(), 0); asserteq!(*d.data(), 42); asserteq!(*d.filled(), true); } ```

👨‍💻👩‍💻 Contribution

Contributions are welcomed especially related to documentation, example code, and fixes. If unsure where to start, open an issue and ask.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in deep_causality by you, shall be licensed under the MIT license without additional terms or conditions.

📜 Licence

This project is licensed under the MIT license.

👮️ Security

For details about security, please read the security policy.

💻 Author