puball 0.1.1

Public all the field in your struct
Documentation
  • Coverage
  • 100%
    2 out of 2 items documented2 out of 2 items with examples
  • Size
  • Source code size: 16.99 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 274.65 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 5s Average build duration of successful builds.
  • all releases: 5s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Avimitin/puball
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • Avimitin

puball

A simple API that help you generate struct with all fields public.

Motivation

A friend of mine wrote a huge struct with 71 pub keywords. It's too hard to write so much pub keywords. Especially when you realize that your forgot to add those visbilty after you finish the sturct design.

Usage

# Cargo.toml

[dependencies]
puball = "0.1"
mod my_space {
    use puball::pub_all;

    pub_all!{
        pub struct NoPrivacy {
            a: i32,
            b: String,
            c: bool,
        }
    }
}

fn main() {
    use my_space::NoPrivacy;

    let np = NoPrivacy {
        a: 1,
        b: String::new(),
        c: true,
    };

    assert_eq!(1, np.a);
    assert!(np.c);
}