-
Notifications
You must be signed in to change notification settings - Fork 38
Open
Description
The idea is to support :packer
option in pack/2
that defaults to Msgpax.Packer
.
This way any default packing can be overwritten with:
defmodule MyPacker do
use Msgpax.Packer
def pack(value) when is_float(value) do
# pack into 32-bit format
end
end
Where use Msgpax.Packer
expands to @behaviour Msgpax.Packer
and also defines the @before_compile
callback that should inject Msgpax.Packer.pack
for catch-all clause.
We still need to think how to efficiently pass the user-provided packer into Msgpax.Packer
for usage when unpacking collections.
Metadata
Metadata
Assignees
Labels
No labels