NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
crates.io
crates.io, #548 most downloaded on crates.io
Internal helper library for the derive_builder crate.
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 28 of 28 stable releases
Nothing withdrawn
no release was ever pulled
10 years old
29 releases · first in 2017
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
syn to version 2 #308darling to version 0.20.6 #308field(type = "...") as syn no longer allows this. #308builder(default = ...) expressions #308Your coding agent can read these notes before it upgrades. Set up the MCP server →
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 = )) 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.
Nothing published for this version
Add 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
removed 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"))] instead### 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
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
for 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.### Added - pre-build validation
derive traits on builder struct
### Added - try_setters
setter(skip) honors struct-inherited and explicit defaults #68
setter(skip) honors struct-inherited and explicit defaults #68Bindings to abstract over libstd/libcore
bindings: Bindings instead of no_std: bool### Added - struct default
helper crate derive_builder_core: Allow derive_builder to use its own code generation technique.
derive_builder_core:
Allow derive_builder to use its own code generation technique.quote::ToTokens:
Allow unit tests on code generation items.One column per quarter.