NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
crates.io · #540 most downloaded on crates.io
Rust macro to automatically implement the builder pattern for arbitrary structs.
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
Allow unquoted expressions in builder(default = ...) #331
builder(default = ...) #331Forward default type params #319
One column per quarter.
BREAKING CHANGE : Remove support for field(type = "...") as syn no longer allows this. #308
Accept 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 = <bool>)) 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
Allow 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
Support 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 in no_std contexts #204
std in no_std contexts #204Requires Rust 1.40.0 or newer (was 1.37.0) #169
Default bound #178derive_builder_core private #189setter(each = "name") for extension of collection-like fields #199Requires Rust 1.40.0 or newer (was 1.37.0) #169
Default bound #178derive_builder_core private #189Add setter(custom) to allow implementing a custom setter #154
setter(custom) to allow implementing a custom setter #154Increase darling dependency to 0.10.2 #153
darling dependency to 0.10.2 #153Increase dependency versions to latest #148
Add strip_option flag for setter #116
strip_option flag for setter #116Updated darling to 0.8.5 and switched to better errors
darling to 0.8.5 and switched to better errorsUpdated all dependencies to latest versions #138
Removed support for deprecated attributes #120
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
T: Clone type bound in builder impl
instead of struct definition #91T: Clone type bound when it is actually needed, i.e.
mutable/immutable pattern, but not owned pattern.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.try_setters, e.g. #[builder(try_setter)]. These setters are exposed alongside the normal field setters and allow callers to pass in values which have
#[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
#[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")]
Requires Rust 1.15 or newer.
#[builder(pattern = "immutable")]#[builder(private)]RUST_LOG=derive_builder=trace cargo test#[builder(setter_prefix = "with")]#[builder(name = "MyBuilder")]FooBuilder struct to build Foo
=> please refer to the new docspreserve ordering of attributes #27
setter-methods are non-consuming now -- breaking change
/// ...#[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
Your coding agent can read these notes before it upgrades. Set up the MCP server →