You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This should create a builder that will construct and fill the shared structure.
Similar to serde(flatten).
This is a common used data structure and would simplify usage.
The text was updated successfully, but these errors were encountered:
Sadly, I don't think this is possible with Rust's macro system. The derive macro on the outer type has no access to the structure of the inner types, and thus cannot generate withers for their fields.
You would need to provide the fields of the struct to flatten, in this example: #[builder(flatten({a: String}))]. This could be automated with a macro that wraps both types, but it will get complicated and ugly...
It would be nice there is a
builder(flatten)
to merge 2 structs into one builder.This should create a builder that will construct and fill the shared structure.
Similar to
serde(flatten)
.This is a common used data structure and would simplify usage.
The text was updated successfully, but these errors were encountered: