-
-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bon::private::Set is qualified in compiler errors while Unset is not #129
Comments
Hi! Thank you for creating an issue. Before we dive into the implementation details of Additionally, I suspect that the feature that is currently WIP in PR #125 may help with your use case as it allows you to pass additional parameters to the Implementation detailsIndeed |
I think I slightly misunderstood the issue title. So your suspicion is that |
That could be the case that Set is qualified because there is some other Set type in one of the other dependencies (even though I don't think one is imported) while Unset is unique. In that case I guess there is no way to fix that. My use-case right now for the type of the partially filled builder is basically that I am writing a trait to convert something in type A recursively into something in one or more values of type B. A contains a few fields that will not be available on every recursion level, just the top level. I could pass those into each call in the recursive conversion trait function, pass them on recursively and then construct a builder locally where I want to construct a value of type B but your blog post about the cloneable builders made me think I could instead just pass in a builder for B where those fields only available at the top level are already set. |
I don't think it's a problem that
Yeah, I don't think using a partial builder would make it simpler because even if you do write the type signature of the partial builder, it'll be a big one, which needs to enumerate states of all members in the builder, at which point I think it gives you no benefit over just passing all "top-level" fields separately. The use case with the partial builder works only in a limited scope (when you don't cross the |
I think what you are missing (and probably Rust language as a whole) is an ability to generate a projection of your type (with only part of the fields available from the original struct). I have such macro in a private repo at work, which I plan to integrate into |
Yes, I think what would be most useful in my use-case would be that plus a way to convert that projected type into a partially filled builder for the full type. |
I created #130 for the projections feature. I'll close this issue as I think it's resolved. |
I am not quite sure what causes that but I a got an error that said (in the full type name file written by the compiler)
I assume Unset is missing a qualifier in some part of the generated code where Set has one.
This came up when I tried to check the type of a partially constructed builder so I can pass it into a function, a use case which I assume is not supported yet judging by the bon::private module path? It does seem useful now that those can be cloned.
The text was updated successfully, but these errors were encountered: