NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
crates.io · #844 most downloaded on crates.io
Compile-time type-checked builder derive
Last release 10 months ago
19 Nov 2025
Release timing varies
gaps range from 8 days to 7 months
Nearly every release is documented
notes for 39 of 40 stable releases
Nothing withdrawn
no release was ever pulled
9 years old
40 releases · first in 2017
Clippy warnings for using &Option<&T> instead of Option<&T> .
&Option<&T> instead of Option<&T>.Clippy warnings for unused variables in the new default implementation.
One column per quarter.
[ BREAKING ] When default is an expression that uses previous fields, it'll receive them as reference.
default is an expression that uses previous fields,default_where option to add generic bounds on default.builder_type(attributes(...)) for adding attributes to the builder typederive)Optional trait. This is an internal implementationNew optional alternate transform syntax using a full fn, to allow support for custom lifetimes, generics and a where clause to custom builder method.
transform syntax using a full fn, to allow support for custom lifetimes, generics and a where clause to custom builder method.Example:
#[derive(TypedBuilder)]
struct Foo {
#[builder(
setter(
fn transform<'a, M>(value: impl IntoValue<'a, String, M>) -> String
where
M: std::fmt::Display
{
value.into_value()
},
)
)]
s: String,
}Recognize TypeGroup when checking for Option .
TypeGroup when checking for Option.Strip raw ident prefix from base method name before assembling prefixed/suffixed fallback method names
Added ignore_invalid option to strip_option to skip stripping for non-Option fields
ignore_invalid option to strip_option to skip stripping for non-Option fieldsfallback_prefix and fallback_suffix options to strip_option for customizing fallback method namesstrip_option and its fallback optionsstrip_option to work better with field defaultsstrip_option more flexible with non-Option fields when ignore_invalid is setFix mutator with type parameter using associated type (see issue #157 )
Add #[builder(setter(strip_option(fallback = field_opt)))] to add a fallback unstripped method to the builder struct.
#[builder(setter(strip_option(fallback = field_opt)))] to add a fallback unstripped method to the builder struct.#[builder(setter(strip_bool(fallback = field_bool)))] to add a fallback setter that takes the bool value to the builder struct.Fix mutators for generic fields (see issue #149 )
Also add the licenses to the macro crate.
Add #[allow(clippy::no_effect_underscore_binding)] to generated methods that need to destructure intermediate builder state.
#[allow(clippy::no_effect_underscore_binding)] to generated methods
that need to destructure intermediate builder state.OR syntax for the dual license.?Sized generic parameters are now supported.
?Sized generic parameters are now supported.Internal refactor of attribute parsing - results in better error messages and easier proces for adding new settings.
#[builder(mutators(...))] to generate functions on builder to mutate fields#[builder(via_mutator)] on fields to allow defining fields initialized
during ::builder() for use with mutatorsmutable_during_default_resolution to allow default expression mutate
previous fields.Use generics with the constructor in build method (see issue #118)
build method (see issue #118)Add #[allow(clippy::exhaustive_enums)] to generated empty enums used for error "reporting" (see issue #112)
#[allow(clippy::exhaustive_enums)] to generated empty enums used for
error "reporting" (see issue #112)#[automatically_derived] to generated impls (see issue #114)#[allow(clippy::used_underscore_binding)] to build method and setter
methods (see issue #113)### Added - #[builder(crate_module_path = ...)] for overcoming cases where the derive macro is used in another crate's macro (see issue #109)
#[builder(crate_module_path = ...)] for overcoming cases where the derive
macro is used in another crate's macro (see issue #109)Fix const generics generating "empty" entries in some lists, resulting in consecutive commas (see issue #106)
### Fixed - no-std build.
[BREAKING] Split the derive macro out to a separate procmacro crate. This is considered a breaking change because reexporting and/or renmaing the crat…
#[deprecated] now behaves properly - TypedBuilder
generated code itself does trigger the deprecation warning, and instead the
setter for that field now does.build method when required fields are not provided now returns
the never type ("!"). Refer to PR #97 for more thorough explanation.#[builder(field_defaults(setter(prefix = "...", suffix = "...")))].
This either prepends or appends the provided string to the setter method. This allows method names like: set_x(),
with_y(), or set_z_value().build_method(into) and build_method(into = ...).
build_method(into) and build_method(into = ...).[BREAKING] Builder state parameter moved to the end of the generated builder type's parameters list.
y
#[builder(build_method(...))] now affects the fake build method that's
generated to add information to the compiler error.[BREAKING] builder_method_doc = "...", builder_type_doc = "..." and build_method_doc = "..." are replaced with builder_method(doc = "..."), builder_ty
builder_method_doc = "...", builder_type_doc = "..." and
build_method_doc = "..." are replaced with builder_method(doc = "..."),
builder_type(doc = "...") and build_method(doc = "...").build_method(...) now has a doc field.builder_method(...) and builder_type(...), which are structured similarly to build_method(...).### Added - #[builder(build_method(vis="pub", name=build))] for customizing visibility and fn name of the final build method (the default visibility i
#[builder(build_method(vis="pub", name=build))] for customizing visibility and fn name of the final build method
(the default visibility is pub, and default build name is build)### Added - #[builder(setter(strip_bool))] for making zero arguments setters for bool fields that just set them to true (the default automatically bec
#[builder(setter(strip_bool))] for making zero arguments setters for bool fields that just
set them to true (the default automatically becomes false)Add extern crate proc_macro; to solve some weird problem
extern crate proc_macro; to solve some weird problem (https://github.com/idanarye/rust-typed-builder/issues/57):: prefixed absolute paths in generated code.Builder type implements Clone when all set fields support clone.
Clone when all set fields support clone.#[builder(setter(transform = ...))] attribute for running a transform on a
setter's argument to convert them to the field's type.Upgraded the Rust edition to 2018.
#[field_defaults(...)] attribute for settings default attributes for all
the fields.Fix lifetime bounds erroneously preserved in phantom generics.
Brought back default_code, because it needed to resolve conflict with other custom derive proc-macro crates that try to parse [#builder(default = ...)
default_code, because it needed to resolve conflict with other
custom derive proc-macro crates that try to parse [#builder(default = ...)]
attribute in order to decide if they are relevant to them - and fail because
the expect them to be simple literals.Ability to use into and strip_option simultaneously for a field.
into and strip_option simultaneously for a field.skip twice in the same builder(setter(...)) is
no longer supported. Then again, if you were doing that you probably deserve
having your code broken.Prevent Clippy from warning about the panic!() in the faux build method.
panic!() in the faux build method.Improve build errors for incomplete .build() and repeated setters, by creating faux methods with deprecation warnings.
doc and skip into a subsetting named setter(...).
This means that #[builder(doc = "...")], for example, should now be written
as #[builder(setter(doc = "..."))].into(). If you want to automatically
convert them, use #[builder(setter(into))]. This new default enables rustc
inference for generic types and proper integer literal type detection..build() and repeated setters, by
creating faux methods with deprecation warnings.#[builder(setter(strip_option))] for making setters for Option fields
automatically wrap the argument with Some(...). Note that this is a weaker
conversion than #[builder(setter(into))], and thus can still support type
inference and integer literal type detection.default_code setting (#[builder(default_code = "...")]) because it is no longer required now that Rust and syn support
arbitrary expressions in attributes.[BREAKING] now state types are placed before original generic types. Previously, all state types are appended to generic arguments. For example, Foo<'
Foo<'a, X, Y> yields FooBuilder<'a, X, Y, ((), ())> previously, and
now it becomes FooBuilder<'a, ((), ()), X, Y, >.. This change fix compiler error
for struct with default type like Foo<'a, X, Y=Bar>. Rust only allow type
parameters with a default to be trailing.[BREAKING] a default_code expression can now refer to the values of earlier fields by name (This is extremely unlikely to break your code, but could i
#![no_std] is now supported out of the box. (You don't need to opt into any
features, it just works.)default_code expression can now refer to the values of
earlier fields by name (This is extremely unlikely to break your code, but
could in theory due to shadowing)#[builder(skip)] on fields, to not provide a method to set that field.#[builder(doc = "…")] on fields, to document the field's method on the
builder. Unlike #[doc], you can currently only have one value rather than
one attribute per line; but that's not a big deal since you don't get to
use the /// sugar anyway. Just use a multiline string.#[builder(doc, builder_method_doc = "…", builder_type_doc = "…", build_method_doc = "…")] on structs:
doc unhides the builder type from the documentation.builder_method_doc = "…" replaces the default documentation that
will be generated for the builder() method of the type for which the
builder is being generated.builder_type_doc = "…" replaces the default documentation that will
be generated for the builder type. Implies doc.build_method_doc = "…" replaces the default documentation that will
be generated for the build() method of the builder type. Implies
doc.TypedBuilder_BuilderFor_Foo to FooBuilder, for improved ergonomics,
especially when you enable documentation of the builder type.
TypedBuilder_genericType_x to
__x. This is still expected to avoid all name collisions, but is easier
to read in the builder type docs if you enable them.TypedBuilder_conversionHelperTrait_Foo to FooBuilder_Optional), and
its method name for simpler code.default_code is now lazily evaluated instead of eagerly; any
side-effects that there might have been will no longer occur. As is usual in
this release, this is very unlikely to affect you.#[builder] attribute per field has
been lifted. You can now write #[builder(skip)] #[builder(default)] instead
of #[builder(skip, default)] if you want to. As was already the case,
latest definition wins.Move the docs from the crate to the custom derive proc macro.
#[builder(default_code = "...")] syntax for defaults that cannot be parsed
as attributes no matter what.Upgraded syn version to support Rust 2018.
syn version to support Rust 2018.#[builder(...)]:
#[default] -> #[builder(default)]#[default=...] -> #[builder(default=...)]default no longer needs to be a string.
Allow missing docs in structs that derive TypedBuilder.
TypedBuilder.Custom derive for generating the builder pattern.
Into values..build().#[default] to make them optional and specify a default value when the user does not set them..builder() method.Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →