Binary-only, json-only encodings
The encoding type should have a second parameter, specifying whether it can be used for Binary, JSON, or both.
Many encodings are defined in a generic way but are intended to be used only in one mode, and wouldn't work in the other one. E.g. unions without JSON disambiguation.
The second parameter would make sure mode-specific encodings are only used in this mode.