Today, there's not really a nice way to do this, for the example protocol:
class Bakery(Protocol):
PacketVariant = HashVariant[lu32]([V1.Message, V2.Message, V3.Message, V4.Message])
Packet = Struct(payload=PacketVariant
Bakery.Packet.fields['payload']
gets me the HashVariantDef
I'd like to be able to do something like
The difficulty will probably lie in what we end up doing for variants, since today a HashVariantDef just stores a list of the underlying types.
wat(BakeryActor.Produces[0].fields['payload'].hash_types[0])
It's probable for all Variants I can have some simple getter function that gets by name? The problem is names can collide. Above, only the QName stores the full name. The type itself just calls itself "Message"
Today, there's not really a nice way to do this, for the example protocol:
gets me the HashVariantDef
I'd like to be able to do something like
The difficulty will probably lie in what we end up doing for variants, since today a HashVariantDef just stores a list of the underlying types.
It's probable for all Variants I can have some simple getter function that gets by name? The problem is names can collide. Above, only the QName stores the full name. The type itself just calls itself "Message"