Vitalii Kryvenko

Results 283 comments of Vitalii Kryvenko

> What are possible options of validating inputs regarding ability to reference already set fields? I'm not sure I understand the full context of this question. Currently `bon` provides a...

Hey guys, I've created an attribute `#[builder(with = closure)]` that allows customizing the setters. Among other, it also accepts the following syntax: `#[builder(with = |param: ty, ...| -> Result {...

Hi @evbo. Currently, it's not possible to do it that way, but you can use a shared function and do it like this: ```rust #[derive(bon::Builder)] struct MyStruct { #[builder(with =...

> A small cool improvement would be to accept not only closures but also functions The problem with this approach is that the builder macro needs to see the full...

@JakubWasilczyk I added the [custom finishing function example](https://bon-rs.com/guide/patterns/fallible-builders#custom-finishing-function) to the fallible builder docs in https://github.com/elastio/bon/pull/277. I'd like to close this issue for now, since I believe the current possibilities with...

> However what would be really useful would be some generic way of passing incomplete builders around. Indeed. right now the builder type signature is unstable. You can see that...

> For complete structs it would make sense to type alias completeness to I'm not sure how this could be useful in general. One use case that I can think...

Some more thoughts on this issue: There isn't just one terminal state for the builder where you can call the finishing functions (`call()` or `build()`). For example: ```rust #[builder] struct...

I've implemented a way to denote the incomplete builder type (with some members set). See #145 for details. It should close this issue once ready

I didn't think of having a macro to derive the `new()` method in `bon`, but it probably fits the domain. However, I suppose it's mostly a solved problem today. As...