PackageTrack
Sign in Get early access

typed-builder

Compile-time type-checked builder derive

0.23.2 98M downloads/mo #817 most downloaded on crates.io idanarye/rust-typed-builder

What this package is like to depend on

Last release 9 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

4 releases in the last 12 months

see the full history below

Release timeline

40 releases · Oct 2017 to Nov 2025
2018 2019 2020 2021 2022 2023 2024 2025 2026
Release Pre-release

Releases

latest 40
  1. 0.23.2 19 Nov 2025
    Release notes

    Fixed

    • Clippy warnings for using &Option<&T> instead of Option<&T>.
    Open source →
    Release notes

    Fixed

    • Clippy warnings for using &Option<&T> instead of Option<&T>.
    Open source →
  2. 0.23.1 16 Nov 2025
    Release notes

    Fixed

    • Clippy warnings for unused variables in the new default implementation.
    Open source →
    Release notes

    Fixed

    • Clippy warnings for unused variables in the new default implementation.
    Open source →
  3. 0.23.0 20 Oct 2025
    Release notes

    Changed

    • Upgrae Rust edition to 2024.
    • [BREAKING] When default is an expression that uses previous fields,
      it'll receive them as reference.

    Added

    • default_where option to add generic bounds on default.
    • builder_type(attributes(...)) for adding attributes to the builder type
      (mainly for derive)

    Removed

    • [BREAKING] The Optional trait. This is an internal implementation
      detail, but some users may have relied on it for customized flows.
    Open source →
    Release notes

    Changed

    • Upgrae Rust edition to 2024.
    • [BREAKING] When default is an expression that uses previous fields, it'll receive them as reference.

    Added

    • default_where option to add generic bounds on default.
    • builder_type(attributes(...)) for adding attributes to the builder type (mainly for derive)

    Removed

    • [BREAKING] The Optional trait. This is an internal implementation detail, but some users may have relied on it for customized flows.
    Open source →
  4. 0.22.0 14 Sep 2025
    Release notes

    Added

    • New optional alternate 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,
    }
    Open source →
    Release notes

    Added

    • New optional alternate 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,
    }
    
    Open source →
  5. 0.21.2 21 Aug 2025
    Release notes

    Fixed

    • Recognize TypeGroup when checking for Option.
    Open source →
    Release notes

    Fixed

    • Recognize TypeGroup when checking for Option.
    Open source →
  6. 0.21.1 12 Aug 2025
    Release notes

    Fixed

    • Strip raw ident prefix from base method name before assembling prefixed/suffixed fallback method names
    Open source →
    Release notes

    Fixed

    • Strip raw ident prefix from base method name before assembling prefixed/suffixed fallback method names
    Open source →
  7. 0.21.0 20 Mar 2025
    Release notes

    Added

    • Added ignore_invalid option to strip_option to skip stripping for non-Option fields
    • Added fallback_prefix and fallback_suffix options to strip_option for customizing fallback method names
    • Added support for field defaults with strip_option and its fallback options

    Changed

    • Improved handling of strip_option to work better with field defaults
    • Made strip_option more flexible with non-Option fields when ignore_invalid is set
    Open source →
    Release notes

    Added

    • Added ignore_invalid option to strip_option to skip stripping for non-Option fields
    • Added fallback_prefix and fallback_suffix options to strip_option for customizing fallback method names
    • Added support for field defaults with strip_option and its fallback options

    Changed

    • Improved handling of strip_option to work better with field defaults
    • Made strip_option more flexible with non-Option fields when ignore_invalid is set
    Open source →
  8. 0.20.1 14 Mar 2025
    Release notes

    Fixed

    • Fix mutator with type parameter using associated type (see issue #157)
    Open source →
    Release notes

    Fixed

    • Fix mutator with type parameter using associated type (see issue #157)
    Open source →
  9. 0.20.0 22 Aug 2024
    Release notes

    Added

    • Add #[builder(setter(strip_option(fallback = field_opt)))] to add a fallback unstripped method to the builder struct.
    • Add #[builder(setter(strip_bool(fallback = field_bool)))] to add a fallback setter that takes the bool value to the builder struct.
    Open source →
    Release notes

    Added

    • Add #[builder(setter(strip_option(fallback = field_opt)))] to add a fallback unstripped method to the builder struct.
    • Add #[builder(setter(strip_bool(fallback = field_bool)))] to add a fallback setter that takes the bool value to the builder struct.
    Open source →
  10. 0.19.1 14 Jul 2024
    Release notes

    Fixed

    • Fix mutators for generic fields (see issue #149)
    Open source →
    Release notes

    Fixed

    • Fix mutators for generic fields (see issue #149)
    Open source →
  11. 0.18.2 16 Apr 2024
    Release notes

    Fixed

    • Also add the licenses to the macro crate.
    Open source →
  12. 0.18.1 16 Jan 2024
    Release notes

    Fixed

    • Add #[allow(clippy::no_effect_underscore_binding)] to generated methods that need to destructure intermediate builder state.
    • Use a proper OR syntax for the dual license.
    Open source →
  13. 0.18.0 19 Oct 2023
    Release notes

    Fixed

    • ?Sized generic parameters are now supported.
    Open source →
  14. 0.17.0 15 Oct 2023
    Release notes

    Changed

    • Internal refactor of attribute parsing - results in better error messages and easier proces for adding new settings.

    Added

    • #[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 mutators
    • mutable_during_default_resolution to allow default expression mutate previous fields.

    Fixed

    • Add support for paths with angle brackets (see PR #122 )
    Open source →
  15. 0.16.2 21 Sep 2023
    Release notes

    Fixed

    • Use generics with the constructor in build method (see issue #118)
    Open source →
  16. 0.16.1 18 Sep 2023
    Release notes

    Fixed

    • Add #[allow(clippy::exhaustive_enums)] to generated empty enums used for error "reporting" (see issue #112)
    • Add #[automatically_derived] to generated impls (see issue #114)
    • Add #[allow(clippy::used_underscore_binding)] to build method and setter methods (see issue #113)
    Open source →
  17. 0.16.0 26 Aug 2023
    Release notes

    Added

    • #[builder(crate_module_path = ...)] for overcoming cases where the derive macro is used in another crate's macro (see issue #109)
    Open source →
  18. 0.15.2 03 Aug 2023
    Release notes

    Fixed

    • Fix const generics generating "empty" entries in some lists, resulting in consecutive commas (see issue #106)
    Open source →
  19. 0.15.1 10 Jul 2023
    Release notes

    Fixed

    • no-std build.
    Open source →
  20. 0.15.0 05 Jul 2023
    Release notes

    Changed

    • [BREAKING] Split the derive macro out to a separate procmacro crate. This is considered a breaking change because reexporting and/or renmaing the crate can now prevent the generated code from finding the types it needs (see issue #101)

    Fixed

    • Marking a field as #[deprecated] now behaves properly - TypedBuilder generated code itself does trigger the deprecation warning, and instead the setter for that field now does.
    • The "fake" build method when required fields are not provided now returns the never type ("!"). Refer to PR #97 for more thorough explanation.

    Added

    • Support for setter method prefixes and suffixes #[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().
    Open source →
  21. 0.14.0 08 Mar 2023
    Release notes

    Added

    • build_method(into) and build_method(into = ...).
    Open source →
  22. 0.13.0 05 Mar 2023
    Release notes

    Changed

    y

    • [BREAKING] Builder state parameter moved to the end of the generated builder type's parameters list.
    • Generated builder type's builder state parameter now defaults to tuple of empty tuples. This means the empty builder, where no parameter is yet set.

    Fixed

    • #[builder(build_method(...))] now affects the fake build method that's generated to add information to the compiler error.
    Open source →
  23. 0.12.0 29 Jan 2023
    Release notes

    Removed

    • [BREAKING] builder_method_doc = "...", builder_type_doc = "..." and build_method_doc = "..." are replaced with builder_method(doc = "..."), builder_type(doc = "...") and build_method(doc = "...").

    Added

    • build_method(...) now has a doc field.
    • builder_method(...) and builder_type(...), which are structured similarly to build_method(...).
    Open source →
  24. 0.11.0 29 Oct 2022
    Release notes

    Added

    • #[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)
    Open source →
  25. 0.10.0 13 Feb 2022
    Release notes

    Added

    • #[builder(setter(strip_bool))] for making zero arguments setters for bool fields that just set them to true (the default automatically becomes false)
    Open source →
  26. 0.9.1 03 Sep 2021
    Release notes

    Fixed

    • Add extern crate proc_macro; to solve some weird problem (https://github.com/idanarye/rust-typed-builder/issues/57)
    • Use unambiguous :: prefixed absolute paths in generated code.
    Open source →
  27. 0.9.0 31 Jan 2021
    Release notes

    Added

    • Builder type implements 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.

    Fixed

    • Fix code generation for raw identifiers.
    Open source →
  28. 0.8.0 06 Dec 2020
    Release notes

    Changed

    • Upgraded the Rust edition to 2018.

    Added

    • #[field_defaults(...)] attribute for settings default attributes for all the fields.
    Open source →
  29. 0.7.1 20 Nov 2020
    Release notes

    Fixed

    • Fix lifetime bounds erroneously preserved in phantom generics.
    Open source →
  30. 0.7.0 23 Jul 2020
    Release notes

    Added

    • Brought back 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.
    Open source →
  31. 0.6.0 17 May 2020
    Release notes

    Added

    • Ability to use into and strip_option simultaneously for a field.

    Changed

    • [BREAKING] Specifying 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.
    Open source →
  32. 0.5.1 26 Jan 2020
    Release notes

    Fixed

    • Prevent Clippy from warning about the panic!() in the faux build method.
    Open source →
  33. 0.5.0 25 Jan 2020
    Release notes

    Changed

    • [BREAKING] Move doc and skip into a subsetting named setter(...). This means that #[builder(doc = "...")], for example, should now be written as #[builder(setter(doc = "..."))].
    • [BREAKING] Setter arguments by default are no longer automatically converted to the target type with 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.
    • Improve build errors for incomplete .build() and repeated setters, by creating faux methods with deprecation warnings.

    Added

    • #[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.

    Removed

    • [BREAKING] Removed the default_code setting (#[builder(default_code = "...")]) because it is no longer required now that Rust and syn support arbitrary expressions in attributes.
    Open source →
  34. 0.4.1 17 Jan 2020
    Release notes

    Fixed

    • [BREAKING] now state types are placed before original generic types. Previously, all state types are appended to generic arguments. For example, 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.
    Open source →
  35. 0.4.0 12 Dec 2019
    Release notes

    Added

    • #![no_std] is now supported out of the box. (You don't need to opt into any features, it just works.)
    • [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 in theory due to shadowing)
    • #[builder(skip)] on fields, to not provide a method to set that field.
    • Control of documentation:
      • #[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.

    Changed

    • [BREAKING] Renamed the generated builder type from TypedBuilder_BuilderFor_Foo to FooBuilder, for improved ergonomics, especially when you enable documentation of the builder type.
      • Generic identifiers were also changed, from 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.
      • Renamed the conversion helper trait for documentation purposes (TypedBuilder_conversionHelperTrait_Foo to FooBuilder_Optional), and its method name for simpler code.
    • [BREAKING] 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.
    • The restriction that there be only one #[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.
    • [BREAKING] Use a single generic parameter to represent the builder type's state (see issue #21). Previously we would use a parameter for each field.

    Changed

    • Move to dual license - MIT/Apache-2.0. Previously this project was just MIT.
    Open source →
  36. 0.3.0 19 Feb 2019
    Release notes

    Added

    • #[builder(default_code = "...")] syntax for defaults that cannot be parsed as attributes no matter what.

    Changed

    • Move the docs from the crate to the custom derive proc macro.
    Open source →
  37. 0.2.0 06 Feb 2019
    Release notes

    Changed

    • Upgraded syn version to support Rust 2018.
    • [BREAKING] Changed attribute style to #[builder(...)]:
      • #[default] -> #[builder(default)]
      • #[default=...] -> #[builder(default=...)]
    • [BREAKING] default no longer needs to be a string.
      • But you need to change your code anyways because the attribute style was changed.
    Open source →
  38. 0.1.1 25 Jul 2018
    Release notes

    Fixed

    • Allow missing docs in structs that derive TypedBuilder.
    Open source →
  39. 0.1.0 05 Oct 2017
    Release notes

    Added

    • Custom derive for generating the builder pattern.
    • All setters are accepting Into values.
    • Compile time verification that all fields are set before calling .build().
    • Compile time verification that no field is set more than once.
    • Ability to annotate fields with #[default] to make them optional and specify a default value when the user does not set them.
    • Generates simple documentation for the .builder() method.
    Open source →
  40. 0.0.0 04 Oct 2017

    Nothing published for this version

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive