Closed Philipp-M closed 1 week ago
This does not yet provide an implementation for xilem (masonry) itself, I'd prefer doing that in a different PR, but I can add that here when it's deemed necessary.
about using a shared context (and state) types for all of these.
Yeah that cleans up all of this a little bit, and also makes the macro more readable...
I also think we should get this hooked up in Xilem proper very soon, to check that this actually covers all use cases.
Yes I can do that in case no one else does this before.
I'd like to finish the xilem_web port though before focusing on xilem, which apart from the orphan views and minimal cleanup just means a generic Message
on the View
AFAICS.
At least in xilem_web I (think I) have tested all the use-cases I currently target this for.
Thanks for the thorough assistance and in-depth review!
I think this is in a good state now, so I'm going to merge this, and add more xilem specific stuff related to this later.
This ports the
OneOfN
views fromxilem_web
toxilem_core
.The new marking mechanism for theBecause of ambiguity, and needing to specify the explicit type whenViewSequence
makes it possible to use the same type as well for an implementation ofViewSequence
, which is provided here as well.OneOf(impl View)
would be used, where animpl ViewSequence
is expected, we have decided to not provide aViewSequence
impl, so that it's not ambiguous, and not necessary to specify the concrete type. We could instead add separate types for aViewSequence
instead likeOneSeqOf2
.Since macros make this unfortunately not super readable, for reviewers of the code this pre-macro version may be better to look at, the only difference to this, is that this has slightly enhanced doc comments, and obviously more than just
OneOf2
.