Cargo Features

[dependencies]
bon = { version = "3.4.0", default-features = false, features = ["std", "alloc", "implied-bounds", "experimental-overwritable", "experimental-getter"] }
default = std

The std feature is set by default whenever bon is added without default-features = false somewhere in the dependency tree.

std default = alloc
alloc std
implied-bounds

See the explanation of what this feature does in the docs here: https://bon-rs.com/guide/typestate-api/custom-methods#implied-bounds

Enables implied-bounds of bon-macros

The version of the macro crate is pinned to a specific one because the code generated by the macros uses private APIs from the runtime crate that are not guarded by semver.

experimental-overwritable

🔬 Experimental! There may be breaking changes to this feature between minor releases, however, compatibility within patch releases is guaranteed though.

This feature enables the #[builder(overwritable)] attribute that can be used to allow overwriting already set fields in the builder. Without this attribute it's not possible to set the same member twice in the builder, a compile error would be generated.

See more info at https://bon-rs.com/reference/builder/top-level/overwritable.

We are considering stabilizing this attribute if you have a use for it. Please leave a 👍 reaction under the issue https://github.com/elastio/bon/issues/149 if you need this attribute. It would also be cool if you could leave a comment under that issue describing your use case for it.

Enables experimental-overwritable of bon-macros

experimental-getter

Legacy experimental attribute. It's left here for backwards compatibility, and it will be removed in the next major release.

We've stabilized the MVP of this feature, so it's no longer experimental. The tracking issue for this feature: https://github.com/elastio/bon/issues/225.