Cargo Features
[dependencies]
bon = { version = "3.1.1", default-features = false, features = ["std", "alloc", "implied-bounds", "experimental-overwritable"] }
- default = std
-
The
std
feature is set by default wheneverbon
is added without
somewhere in the dependency tree.default-features = false - 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