Expand description
Differences from derive_builder
- Not all derive_builder attributes have been cloned: only the ones that we used.
- Attributes have been adjusted where possible to be easier to use.
- It is not necessary to use
impl_standard_builder! - The appropriate
serdeattributes are automatically provided on the builder. - Every field must have some default behavior specified, or must have the
no_defaultoption given. (Withderive_builder,no_defaultis the default, which can result in confusing test failures.) - Sub-builders are supported.
- The
cfgattribute can be used to warn when the user tries to provide a value for an compiled-out field. - There is (limited) support for generics.
- The generated documentation is a little better.
validatehas been renamed topre_build.- There is
post_buildattribute to replace the pattern where we would rename the build function, make it private, and wrap it. - A top-level
build_fndoes not override the build function on sub-builders. - The list builder and map builder patterns are supported via attributes; you don’t need separate macros for them.
- Builders automatically derive
ExtendBuilder,Flattenable, andBuilder. - The configuration type automatically derives
Buildable. - Visibility is set more reasonably.
- For many types, we automatically generate setters or serde code that conforms to our standards.