Snex.Serde.Encoder protocol (Snex v0.2.0)

View Source

Protocol for custom encoding of Elixir terms to JSON used by Snex Serde.

If no implementation is defined, encoding falls back to JSON encoding (JSON.Encoder and its defaults).

See the Snex module documentation for more detail.

Summary

Types

t()

All the types that implement this protocol.

Functions

A function invoked to encode the given term to iodata/0.

Types

encoder()

@type encoder() :: (term(), encoder() -> iodata())

t()

@type t() :: term()

All the types that implement this protocol.

Functions

encode(term, encoder)

@spec encode(term(), encoder()) :: iodata()

A function invoked to encode the given term to iodata/0.