Boltx.PackStream.Packer protocol (Boltx v0.0.4)

The Boltx.PackStream.Packer protocol is responsible for serializing any Elixir data structure according to the PackStream specification.

Serializing for structs

By default, all structures are serialized with all their fields. However, if it is necessary that only certain fields be considered for serialization, it is necessary to perform a derivation. Below is an example:

defmodule Book do
  @derive [{Boltx.PackStream.Packer, fields: [:name]}]
  defstruct [:name, :other_data]
end`

Summary

Types

t()

All the types that implement this protocol.

Types

@type t() :: term()

All the types that implement this protocol.

Functions