msgpax icon indicating copy to clipboard operation
msgpax copied to clipboard

Introduce overridable protocol implementations

Open y86 opened this issue 10 months ago • 0 comments

Depends on #67 Closes #60 Enables the solution of #61 and #62

The goal of this PR is to introduce a way for users to override default implementations from the library, In order to achieve that, several changes were introduced:

  • #67 that allows options to be used to configure implementations;
  • Refactoring of how extensions are represented: instead of having one struct Msgpax.Ext, we have 128 structs, one for each extension type;
  • new Msgpax.Unpacker protocol that can be dispatched against the specific Msgpax.Ext# structs;
  • new Msgpax.Ext.defimpl macro to allow users to overwrite protocol implementations without triggering warnings about module redefinition;

y86 avatar Aug 25 '23 21:08 y86