bon 3.1.1

Next-gen compile-time-checked builder generator, named function's arguments, and more!
Documentation
[package]
name    = "bon"
version = "3.1.1"

description = "Next-gen compile-time-checked builder generator, named function's arguments, and more!"

categories = [
  "rust-patterns",
  "data-structures",
  "asynchronous",
  "no-std",
  "no-std::no-alloc",
]
keywords = ["builder", "macro", "derive", "constructor", "setter"]

edition    = "2021"
homepage   = "https://bon-rs.com"
license    = "MIT OR Apache-2.0"
repository = "https://github.com/elastio/bon"

# This MSRV was chosen because Rust supports mixing generic type and const
# parameters only starting with this version. We require this feature for the
# cases when the builder is generated for a function or struct that uses const
# generics. The generated builder **always** appends a generic type parameter
# for the type state at the end of the Builder generics list. So for functions
# or structs that use const generics the generated builder will have a generic
# type parameter after the const generic parameter, which is only supported
# starting from Rust 1.59.0.
rust-version = "1.59.0"

[package.metadata.docs.rs]
all-features = true

# Generate clickable links in the source code view in the docs
rustdoc-args = ["--generate-link-to-definition"]

# We don't need the docs to be built for every first-tier target.
# This crate is not platform-specific.
targets = ["x86_64-unknown-linux-gnu"]

[lints]
workspace = true

[dependencies]
# 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.
bon-macros  = { path = "../bon-macros", version = "=3.1.1" }
rustversion = "1"

[dev-dependencies]
# Using a bit older version that supports our MSRV
expect-test = "1.4.1"

# Using a bit older version that supports our MSRV
tokio = { version = "1.29.1", features = ["macros", "rt-multi-thread"] }

# Using a bit older version that supports our MSRV
trybuild = "1.0.89"

[features]
alloc   = []
default = ["std"]
std     = ["alloc"]

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

# 🔬 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.
experimental-overwritable = ["bon-macros/experimental-overwritable"]