rust-typed-builder
rust-typed-builder copied to clipboard
Compile-time type-checked builder derive
```rust use typed_builder::TypedBuilder; #[derive(TypedBuilder)] struct Foo { // Mandatory Field: x: i32, // #[builder(default)] without parameter - use the type's default // #[builder(setter(strip_option))] - wrap the setter argument with `Some(...)`...
I would love to see a feature that allows to set a context for the builder. The context could then be used in the default functions. To keep the `builder()`...
Was just thinking which kind of language features could help with a cleaner approach compared "impl on tuple shadowing" and "sealed enums" – which is a creative way to solve...
# Reason 1) `Option` semantics in rust are naturally "optional", and ideally wouldn't have to set them on the builder. 2) It would also remove the need to `strip_default` on...
I have a a value coming from `clap` argument parsing that might or might not be set (so it's `Option`, and I want to use it (if set) to override...
Hi! I want to use the builder together with `config-rs` to use config from a file as input for the builder. For that the builder struct must support `Deserialize`. How...
I'll preface this by saying that my idea is a huge breaking change, and I'm more interested to hear feedback on whether this would even work. Currently, `typed-builder` requires the...
# Context I'd like to remind how [specifying dependencies](https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#caret-requirements) works in Cargo.toml. When you specify a bare version e.g. `foo = "0.1"` , cargo prepends a caret operator by default...
Hi, It would be great, if `typed-builder` could use the doc strings of the struct attributes as doc strings of the builder methods. Right now, it seems, it's not possible...
#[builder(default = ...)] for generic field got error "expected type parameter, found concrete type"
```rust #[derive(TypedBuilder)] struct Foo { #[builder(default = 12)] x: T, } ``` ``` error[E0308]: mismatched types --> tests/tests.rs:60:29 | 59 | struct Foo { | - this type parameter 60...