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
When we create a tagged array_like struct, it is not possible to influence where the tag field is in the field order. This prevents using this feature to implement msgpack-rpc. In msgpack-rpc, the request is a 4-element array [type,msgid,method,params], where the type of params depends on the method. An intuitive way to implement this would be to create a single struct for each method, tagged by the 'method' field, and then use a Union of those to decode the request. However, this currently cannot be done as there is no way to put the tag on the third position.
In contrast to that, for JSON-RPC (where requests are dicts instead of arrays, this can be done):
Description
When we create a tagged
array_like
struct, it is not possible to influence where the tag field is in the field order. This prevents using this feature to implement msgpack-rpc. In msgpack-rpc, the request is a 4-element array[type,msgid,method,params]
, where the type of params depends on the method. An intuitive way to implement this would be to create a single struct for each method, tagged by the 'method' field, and then use a Union of those to decode the request. However, this currently cannot be done as there is no way to put the tag on the third position.In contrast to that, for JSON-RPC (where requests are dicts instead of arrays, this can be done):
The text was updated successfully, but these errors were encountered: