1 unstable release

new 0.1.0 Apr 21, 2025

#896 in Procedural macros

MIT license

8KB

Contributors Forks Stargazers Issues MIT License LinkedIn


easy_macro

Most usefull rust macros
Explore the docs »

Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Contributing
  5. License
  6. Contact

About The Project

I have created a library for combine all rust macro what i use in one place. I tryed make this macro max readable.

(back to top)

Getting Started

Just add new dependencie in your Cargo.toml file.

  • Cargo.toml
    [dependencies]
    easy_macro = "0.1"
    

Usage

use easy_macro::EasyBuilder;

#[derive(EasyBuilder)]
struct MyStruct {
    field1: i32,
    field2: String,
}

impl Default for MyStruct {
  fn default() -> Self {
    Self {
      field1: 0,
      field2: String::from("123123")
    }
  }
}

fn main() {
  let builded_struct = MyStruct::default().set_field1(42).set_field2(String::from("pewpew"));
}

For more examples, please refer to the Documentation

(back to top)

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

License

Distributed under the MIT License. See LICENSE.txt for more information.

(back to top)

Contact

Bogdan Lipovtsev - megafreelancer2012@gmail.com

Project Link: https://github.com/zaqxsw-dev/easy_macro

(back to top)

Dependencies

~1.5MB
~38K SLoC