Unpacking Types over function channel

Consider the following:


What is a better way to go about this? I want to handle both types in my rec function.

Something like this or this?

So I like the second example however I still run into the problem if trying to recreate the object VxHeader<T>

You really have to explain what you're trying to do in more detail. Why do you need a generic parameter?

Like Alice said, maybe identifying what you'd like done would help us help you. Here, I tried filling-in-the-gaps of what I might of wanted in your position, although I would do it differently. Regardless:


1 Like

Would something like this work using trait objects playgound. It would remove the need for explicit generics but give you the same flexibility as long as every V* struct impl's the VxType.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.