bon
bon copied to clipboard
Next-gen compile-time-checked builder generator, named function's arguments, and more!
The motivation for this feature is [this reddit comment](https://www.reddit.com/r/rust/comments/1fgmbo7/comment/ln87l3u/?utm_source=share&utm_medium=web3x&utm_name=web3xcss&utm_term=1&utm_content=share_button). I propose the following attributes design: ### Structs ```rust /// Struct docs (not copied anywhere) #[derive(bon::Builder)] #[builder( builder_type(docs( /// Builder type...
We need a suite of benchmarks that measure the compile time overhead of generating builders with bon. It would be great to have comparisons with: - no builders at all...
I have such proc macro already implemented in a private repo at work. So this issue is basically a note for myself to move it to `bon` and expose as...
Allow for groups and conflicts like in clap. A feature like this can be seen in [`const_typed_builder`](https://crates.io/crates/const_typed_builder) but according to crate's docs it requires significant compile time overhead. The main...
preferably in crypto ### A note for the community from the maintainers Please vote on this issue by adding a 👍 [reaction](https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) to help the maintainers with prioritizing it.
This is based on a [reddit comment](https://www.reddit.com/r/rust/comments/1f6d7vr/comment/ll13ul1/?utm_source=share&utm_medium=web3x&utm_name=web3xcss&utm_term=1&utm_content=share_button) The proposal is to implement a builder that uses `MaybeUninit` under the hood and does `ptr::write/read` to access the underlying fields. It does...
We can have CI jobs that check out the git repos of some crates that use bon, patch them to use the local version of `bon` (from the current bon...
# Context I wrote some experimental code to generate completions for the builder macro [here](https://github.com/elastio/bon/blob/master/bon-macros/src/util/ide.rs). It was showcased in the [2.0 update blog post](https://elastio.github.io/bon/blog/bon-builder-generator-v2-release#experimental-completions-with-rust-analyzer). However, the current impl is rather...
If you click on any `Source` link for the methods in [this library](https://docs.rs/remoteit-api/latest/remoteit_api/struct.R3Client.html#method.get_files_async), the line of code that is opened is the line of `#[bon]` macro call site, not the...
When applying the builder pattern I find that something useful is the conversion from the built type to the builder, for example: ```rust #[derive(Default)] struct Animal { name: String, color:...