Skip to content

Releases: colin-kiegel/rust-derive-builder

2017-04-26

26 Apr 13:05
Compare
Choose a tag to compare

Added

  • pre-build validation via #[builder(build_fn(validate="path::to::fn"))]

2017-04-12

25 Apr 14:31
Compare
Choose a tag to compare

Added

  • customize setter names via #[builder(setter(name="..."))]
  • customize build_fn name via #[builder(build_fn(name="..."))]
  • suppress build method generation via #[builder(build_fn(skip))]
  • derive additional traits via #[builder(derive(Trait1, Trait2, ...))]
  • set field visibility separate from setter visibility via
    #[builder(field(private))] at the field or struct level

Deprecated

  • 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 at
    the struct or field level using the new #[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.

2017-04-12

12 Apr 08:40
Compare
Choose a tag to compare

Added

  • fallible setters, e.g. #[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.

2017-04-11

11 Apr 22:02
Compare
Choose a tag to compare

Fixed

  • setter(skip) honors struct-inherited and explicit defaults #68

2017-04-10

10 Apr 09:06
Compare
Choose a tag to compare

Fixed

  • support generic references in structs #55
  • support #![no_std] #63

2017-04-08

08 Apr 21:09
Compare
Choose a tag to compare

Deprecated

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

2017-03-25

25 Mar 21:06
Compare
Choose a tag to compare

Added

  • skip setters, e.g. #[builder(setter(skip))]
  • default values, e.g. #[builder(default="42")] or just #[builder(default)]

Changed

  • deprecated syntax #[builder(setter_prefix="with")],
    please use #[builder(setter(prefix="with"))] instead
  • setter conversions are now off by default, you can opt-into via
    #[builder(setter(into))]
  • logging is behind a feature flag. To activate it, please add
    features = ["logging"] to the dependency in Cargo.toml. Then you can use
    it like: RUST_LOG=derive_builder=trace cargo test.

Fixed

  • use full path for result #39
  • support #[deny(missing_docs)] #37
  • support #![no_std] via #[builder(no_std)] #41

macros 1.1

05 Feb 22:10
Compare
Choose a tag to compare

Added

  • different setter pattern, e.g. #[builder(pattern="immutable")]
  • private setters, e.g. #[builder(private)]
  • additional debug info via env_logger, e.g. RUST_LOG=derive_builder=trace cargo test
  • prefixes, e.g. #[builder(setter_prefix="with")]
  • field specific overrides
  • customize builder name, e.g. #[builder(name="MyBuilder")]

Changed

  • migration to macros 1.1
  • migration to traditional builder pattern
    i.e. seperate FooBuilder struct to build Foo
    => please refer to the new docs

Fixed

  • missing lifetime support #21

preserve ordering of attributes

24 Sep 12:29
Compare
Choose a tag to compare

attributes and non-consuming

22 Aug 10:54
Compare
Choose a tag to compare

Have a look at the CHANGELOG.md for all additions and changes.

Or have a look at the commit history here:
v0.1.0...v0.2.0