-
Notifications
You must be signed in to change notification settings - Fork 180
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
Converging a payload from two different projections #1151
Comments
Honestly I'm not very happy with the concept of RcStruct (which is why we need |
I replied here: What @Manishearth said is correct. We can't coalesce the two projections to the same type because we carry a cart around. This is because we support 3 different ownership models in DataPayload:
The "cart" type parameter feeds case 2; it allows the client to supply structured data and borrow from it. To resolve the issue, we could:
As stated in the other thread, I suggest we do option 2 for now, and keep this issue to discuss when we have more time and aren't in a crunch. |
I'm not sure how (2) is solving it. How can I get a static pattern into |
Yeah, additionally a thing to point out is that the
|
Can we project from Yoke<P1,C1> to Yoke<P2,C2> where C1 can be transformed into C2 (e.g. an enum variant)? |
I don't think there's a way to do that safely because yoke won't know what part of the cart is borrowed and if it was preserved. That said we might be able to introduce an unsafe I'm still not convinced that RcStruct is worth it, or that it makes sense given the design of Yoke. It introduces another associated type, and all we use that type for is its destructor, while it constrains us. If we really want something like RcStruct I'd prefer we used |
How would you make such a type? The |
Oh, actually it can be any object safe trait, I picked Yoke would need a constructor that handles this but it would be a simple cast. |
Discussion of this solution (and a bigger one) in #1262 |
For #519 I'm using the following manual projections to allow for patterns to pattern projection:
Now I have a case where I need to project from a different payload to the same result payload and store that result on
DateTimeFormat
.This means I need
PatternFromPatternsV1Marker
andPatternFromSkeletonsV1Marker
and I'd like to end up with a single payload type that wrapsPatternV1
.How to do that?
The text was updated successfully, but these errors were encountered: