use buildstructor::buildstructor; pub struct Generic { simple: T, } #[buildstructor] impl Generic { #[builder] fn new(simple: T) -> Generic { Self { simple } } } fn main() { let generic = Generic::builder().simple(2).build(); assert_eq!(generic.simple, 2); }