pubs 0.1.0

This crate simply adds pub for you on your struct or impl functions.
Documentation
  • Coverage
  • 20%
    1 out of 5 items documented0 out of 4 items with examples
  • Size
  • Source code size: 6.57 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 288.21 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
  • StrongTheDev/pubs
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • StrongTheDev

PUBS.

This crate simply adds pub for you on your struct or impl functions.

Example usage:

// main.rs
use models::Test;
mod models {
    use pubs::{PubSkip, pub_methods, pub_struct};
    #[derive(PubSkip)] // Helps you use the "#[skip]" attribute to skip making a given field public
    #[pub_struct]
    struct Test {
        name: String,
        #[skip] // This makes age private (the default)
        age: u8,
    }
    #[pub_methods]
    impl Test {
        fn new(n: &str, a: u8) -> Self {
            Self {
                name: n.into(),
                age: a,
            }
        }
    }
}
fn main() {
    let _human = Test::new("Strong the dev", 255);
}