Conduit v0.12.10 Conduit.ContentType.ErlangBinary View Source

Handles converting to and from an erlang binary.

Link to this section Summary

Functions

Formats the body to erlang binary

Parses the body from erlang binary

Link to this section Functions

Formats the body to erlang binary.

Examples

iex> import Conduit.Message
iex> message =
iex>   %Conduit.Message{}
iex>   |> put_body(%{})
iex>   |> Conduit.ContentType.ErlangBinary.format([compressed: 6])
iex> :erlang.binary_to_term(message.body)
%{}

Parses the body from erlang binary.

Examples

iex> import Conduit.Message
iex> message =
iex>   %Conduit.Message{}
iex>   |> put_body(<<131, 116, 0, 0, 0, 0>>)
iex>   |> Conduit.ContentType.ErlangBinary.parse([])
iex> message.body
%{}