Liberator.MediaType behaviour (liberator v3.0.0)

View Source

A behaviour module for media type codecs.

Liberator uses this behaviour to help make sure at compile-time that codecs will be called successfully. Include it in your own module for the same peace of mind.

Summary

Callbacks

Encode an Elixir term into an encoded binary, and raise if there's an error.

Callbacks

encode!(term)

@callback encode!(term()) :: binary()

Encode an Elixir term into an encoded binary, and raise if there's an error.