NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
crates.io
crates.io, #547 most downloaded on crates.io
Rust macro to automatically implement the builder pattern for arbitrary structs.
Latest stable
0.20.2
Last release 2 years ago
no release in 18 months
Release timing varies
gaps range from 3 weeks to 1.2 years
Nearly every release is documented
notes for 33 of 33 stable releases
Nothing withdrawn
no release was ever pulled
10 years old
34 releases · first in 2016
Drag across the ruler to compare, or tap a release to open it.
Allow unquoted expressions in builder(default = ...) #331
builder(default = ...) #331Forward default type params #319
BREAKING CHANGE: Remove support for field(type = "...") as syn no longer allows this. #308
Your coding agent can read these notes before it upgrades. Set up the MCP server →
syn to version 2 #308darling to version 0.20.6 #308field(type = "...") as syn no longer allows this. #308builder(default = ...) expressions #308Accept field(ty = "...") as an alias for field(type = "...") in preparation for moving to syn 2.0, which doesn't allow the use of keywords as meta ite
field(ty = "...") as an alias for field(type = "...") in preparation for moving to syn 2.0, which doesn't allow the use of keywords as meta item paths. #306Add build_fn(error(validation_error = )) to disable generation of ValidationError within the builder's error so that alloc::string is avoided.
build_fn(error(validation_error = <bool>)) to disable generation of ValidationError within the builder's error so that alloc::string is avoided.alloc for controlling linking of alloc crate during no_std. This way users can use no_std without providing a global_allocator.strip_option from setter for try_setter. Using these settings together previously caused a compile error #284Produce error when default is used with field(type = "...") rather than silently ignoring default #269
default is used with field(type = "...") rather than silently ignoring default #269crate = "..." to support re-export scenarios #274Allow restricted visibility using vis = "..." for builders, build methods, setters, and fields #247
vis = "..." for builders, build methods, setters, and fields #247#[builder(field(type = "..."))] #246#[builder(field(build = "..."))] #246darling, proc-macro2, syn, and quote dependencies #250Forward allow and cfg attributes from the deriving struct to the builder and its impl block #222
allow and cfg attributes from the deriving struct to the builder and its impl block #222#[builder_struct_attr(...)] #241impl block using #[builder_impl_attr(...)] #241Support shorthand and long-form collection setters; #[builder(setter(each = "..."))] and #[builder(setter(each(name = "...")))] #234
#[builder(setter(each = "..."))] and #[builder(setter(each(name = "...")))] #234Into using `#[builder(setter(each(name = "...", into)))] #234 and #214#[builder_field_attr(...)] and #[builder_setter_attr(...)] #237Note: This version didn't have anything that clearly required a minor version increase; however, given the amount of time and number of commits since last publication a conservative approach was taken.
Don't include derive_builder_core in derive_builder so that no_std builds #206
derive_builder_core in derive_builder so that no_std builds #206Don't reference std when in no_std context #204
std when in no_std context #204alloc is now stable #202Requires Rust 1.40.0 or newer (was 1.37.0) #169
This release changes how derive_builder handles errors; instead of returning a string, a structured error is now returned from build. This implements std::error::Error, making it easy to use alongside libraries such as anyhow, and it is replaceable, making it easy to drop in your library's own error instead. In addition, this approach means that builders no longer force any allocations, useful in no_std contexts.
Requires Rust 1.40.0 or newer (was 1.37.0) #169
Default bound #178derive_builder_core private #189Add setter(custom) support #154
setter(custom) support #154Bump darling dependency to 0.10.2 to support rust's new minimal-versions CI feature #153
darling dependency to 0.10.2 to support rust's new minimal-versions CI feature #153Bump Rust min verson to 1.37.0 (was 1.18.0) #148
Add strip_option to setter options #116
Add strip_option to setter options #116
Improve error experience using latest version of darling #142
darling #142* Update all dependencies #138
Fix a variety of bugs by updating to darling for attribute parsing.
Fix a variety of bugs by updating to darling for attribute parsing.
syn 0.13.10. #120quote 0.5.2 #120Clone is no longer derived on a builder using the owned pattern unless it
has a field override that uses the mutable/immutable pattern. #97#[builder(private)] at the struct level will now emit a private builder. #99build_fn(private) to generate a build method only accessible within the mod scope #89darling 0.6.3 #120The standard library collections crate was merged into alloc (PR). Correspondingly when using this crate within a crate with #![no_std] you must use #
collections crate was merged into alloc
(PR).
Correspondingly when using this crate within a crate with #![no_std] you must
use #![feature(alloc)] extern crate alloc in your crate,
was #![feature(collections)] extern crate collections.unused_mut lint (variable does not need to be mutable) #104removed previously deprecated syntax #[builder(setter_prefix="with")], please use #[builder(setter(prefix="with"))] instead
#[builder(default)] and #[builder(default="...")] at the struct level
change their behaviour and construct a default value for the struct,
instead of all fields individually.#[builder(field(public))]#[builder(setter_prefix="with")],
please use #[builder(setter(prefix="with"))] insteadfor generic structs, apply the T: Clone type bound in builder impl instead of struct definition #91
pre-build validation via #[builder(build_fn(validate="path::fn"))]
#[builder(build_fn(validate="path::to::fn"))]builder fields will no longer be public by default in 0.5.0; relying on this will now emit a deprecation warning. Fields can be explicitly made public…
#[builder(setter(name="..."))]#[builder(build_fn(name="..."))]#[builder(build_fn(skip))]#[builder(derive(Trait1, Trait2, ...))]#[builder(field(private))] at the field or struct level#[builder(field(public))]
attribute. To squelch this warning and opt-into the new behaviour, use the
private_fields crate feature or explicitly set field visibility at the
struct level.fallible setters, e.g. #[builder(try_setter)]. These setters are exposed alongside the normal field setters and allow callers to pass in values which
#[builder(try_setter)]. These setters are exposed
alongside the normal field setters and allow callers to pass in values which
have fallible conversions to the needed type through TryInto. This
attribute can only be used on nightly when #![feature(try_from)] is
declared in the consuming crate's root; this will change when Rust issue
#33417 is resolved.setter(skip) honors struct-inherited and explicit defaults #68
setter(skip) honors struct-inherited and explicit defaults #68support generic references in structs #55
#![no_std] #63### Deprecated - #[builder(default)] and #[builder(default="...")] at the struct level will change their behaviour in 0.5.0 and construct a default va
#[builder(default)] and #[builder(default="...")] at the struct level will
change their behaviour in 0.5.0 and construct a default value for the struct,
instead of all fields individually. To opt into the new behaviour and squelch
this deprecation warning you can add the struct_default feature flag.deprecated syntax #[builder(setter_prefix="with")], please use #[builder(setter(prefix="with"))] instead
#[builder(setter(skip))]#[builder(default="42")] or just #[builder(default)]#[builder(setter_prefix="with")],
please use #[builder(setter(prefix="with"))] instead#[builder(setter(into))]features = ["logging"] to the dependency in Cargo.toml. Then you can use
it like: RUST_LOG=derive_builder=trace cargo test.#[deny(missing_docs)] #37#![no_std] via #[builder(no_std)] #41different setter pattern, e.g. #[builder(pattern="immutable")]
Added
#[builder(pattern="immutable")]#[builder(private)]RUST_LOG=derive_builder=trace cargo test#[builder(setter_prefix="with")]#[builder(name="MyBuilder")]Changed
FooBuilder struct to build Foo
=> please refer to the new docsFixed
preserve ordering of attributes #27
Have a look at the CHANGELOG.md for all additions and changes.
Have a look at the CHANGELOG.md for all additions and changes.
Or have a look at the commit history here: https://github.com/colin-kiegel/rust-derive-builder/compare/v0.1.0...v0.2.0
/// ...#[doc = ...]#[cfg(...)]#[allow(...)][Unreleased]: https://github.com/colin-kiegel/rust-derive-builder/compare/v0.5.1...HEAD [0.5.1]: https://github.com/colin-kiegel/rust-derive-builder/c
One column per quarter.