This crate simply adds pub for you on your struct or impl functions.
// 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);
}