Flippant v0.2.0 Flippant.Serializer behaviour

Rules may be stored with arbitrary values. For some storage environments, like Redis, the values must be serialized to and from a binary format.

By default all load and dump operations use Erlang’s binary to term conversion. This isn’t especially portable, or readable, so it can be overridden within your app’s configuration.

Example

Application.put_env(:flippant, serializer: MySerializer)

Summary

Functions

Delegates dumping a value to the configured serializer

Delegates loading a value with the configured serializer

Get the currently configured serializer module. Defaults to Term storage

Functions

dump(value)

Specs

dump(any) :: binary

Delegates dumping a value to the configured serializer.

load(value)

Specs

load(binary) :: any

Delegates loading a value with the configured serializer.

serializer()

Specs

serializer :: module

Get the currently configured serializer module. Defaults to Term storage.

Callbacks

dump(value)

Specs

dump(value :: any) :: binary
load(value)

Specs

load(value :: binary) :: any