pubs

Crates.iopubs
lib.rspubs
version0.1.0
created_at2025-08-25 20:47:58.996159+00
updated_at2025-08-25 20:47:58.996159+00
descriptionThis crate simply adds pub for you on your struct or impl functions.
homepage
repositoryhttps://github.com/StrongTheDev/pubs
max_upload_size
id1810118
size6,570
Agani Daniel .S (StrongTheDev)

documentation

README

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);
}
Commit count: 2

cargo fmt