Kitt.Encoder.encode_message
You're seeing just the function
encode_message
, go back to Kitt.Encoder module for more information.
Specs
encode_message(message() | map(), atom(), [{:format, :hex | :binary}]) :: {:ok, binary()} | {:error, term()}
Takes a Kitt message struct or comparable message data as a basic Elixir map as well as an explicit message type atom and encodes the message to a binary representation of the message.
By default the message is encoded to a hexadecimal representation but the optional
keyword argument format: :hex | :binary
can explicitly define the desired output
format.
Resulting binary is wrapped in an :ok
tuple, else an {:error, reason}
is
returned.