#derive-builder #builder-pattern #builder #derive #proc-macro #procedural

macro builder_derive_more

Additional procedural macros for the builder pattern

1 unstable release

0.1.0 Jan 6, 2024

#22 in #derive-builder

Download history 2/week @ 2024-01-11 4/week @ 2024-01-18 31/week @ 2024-01-25 31/week @ 2024-02-01 20/week @ 2024-02-08 44/week @ 2024-02-15 36/week @ 2024-02-22 16/week @ 2024-02-29 67/week @ 2024-03-07 11/week @ 2024-03-14 14/week @ 2024-03-21 29/week @ 2024-03-28 8/week @ 2024-04-04 31/week @ 2024-04-18 93/week @ 2024-04-25

137 downloads per month
Used in 4 crates (3 directly)




crates.io Rust codecov

Additional Rust procedural macros for the builder pattern.



Add builder_derive_more as a Rust dependency to your Cargo.toml manifest.

builder_derive_more = "0.1"


Hereafter, you can #[derive(IntoBuilder)] alongside deriving the builder pattern (e.g. via derive_builder).

use builder_derive_more::IntoBuilder;
use derive_builder::Builder;

#[derive(Builder, IntoBuilder)]
pub struct Foo {
    bar: String,

This allows you to convert from the struct with named fields back into the builder for configuration.

// `IntoBuilder` derive provides the `Foo::builder()` and `Foo::configure(self)` methods.
let foo: Foo = Foo::builder().bar("bar").build().unwrap();
let foo_builder: FooBuilder = foo.configure();


This project is dual-licensed to be compatible with the Rust project, under either the MIT or Apache 2.0 licenses.


Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.


~18K SLoC