# `Decree.Store.Serializer`
[🔗](https://github.com/sparkle-space/decree/blob/v0.1.0/lib/decree/store/serializer.ex#L1)

Specification of a serializer to convert between an Elixir term and its
representation in the database.

# `config`

```elixir
@type config() :: Keyword.t()
```

# `t`

```elixir
@type t() :: module()
```

# `deserialize`

```elixir
@callback deserialize(binary() | map(), config()) :: any()
```

Deserialize the given data to the corresponding term.

# `known_type?`
*optional* 

```elixir
@callback known_type?(type :: String.t()) :: boolean()
```

Whether `deserialize/2` can build an event of the given type: `false` for a type this
release does not define, such as one appended by a newer release.

Optional. A serializer that does not implement it knows every type. A read that meets an
unknown type raises `Decree.Store.UnknownEventTypeError`, and a subscription holds before
the event instead of delivering past it.

# `serialize`

```elixir
@callback serialize(any()) :: binary() | map()
```

Serialize the given term to a representation that can be stored by the
database.

# `serializer`

Get the serializer module from the given config for the event store.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
