best_macros

Crates.iobest_macros
lib.rsbest_macros
version0.1.3
sourcesrc
created_at2021-10-13 11:47:33.80468
updated_at2021-10-14 14:11:14.333046
descriptionThis crate was created for optimize coding in RUST
homepage
repositoryhttps://github.com/tehnarenok/best_macros/
max_upload_size
id464487
size5,180
Mikhail Ershov (tehnarenok)

documentation

README

The best macros fo RUST

About this crate

This crate was created when I had a macros for creating pub structs where all fileds are public.

Last changes

  • Add public_struct macros.

How to use

Public struct

Previously, to implement a public structure with public fields, you wrote

pub struct Ticket {
    pub id: String,
    pub museum_id: String,
    pub description: String,
    pub date: String,
    pub time: String,
    pub quantity_groups: Vec<QuantityGroup>,
}

Now you can write like this

use best_macros::public_struct;

...

#[public_struct]
struct Ticket {
    id: String,
    museum_id: String,
    description: String,
    date: String,
    time: String,
    quantity_groups: Vec<QuantityGroup>,
}

And this struct and all her fields become a public.

PS

Write your ideas in issue and I will try to implement them

Commit count: 11

cargo fmt