#builder-pattern #derive-builder #builder #macro-derive #design-pattern #macro #derive

auto-builder-core

A derive macro to implement the builder pattern for any struct

2 unstable releases

0.2.0 Jan 21, 2024
0.1.0 Jan 20, 2024

#1078 in Procedural macros


Used in 2 crates (via auto-builder-macro)

MIT license

7KB
139 lines

Crates.io Version GitHub Actions Workflow Status

auto-builder

This crate provides a derive macro that implements the builder pattern for any struct.

#[derive(Builder)]
struct Foo {           
    a: i32,
    b: Option<i32>,
 }

let foo = FooBuilder::new().a(1).b(Some(2)).build();
assert!(foo.is_ok());

Dependencies

~310–760KB
~18K SLoC