View Source Msgpax.Bin (Msgpax v2.4.0)

A struct to represent the MessagePack Binary type.

Elixir binaries are serialized and deserialized as MessagePack strings: Msgpax.Bin is used when you want to enforce the serialization of a binary into the Binary MessagePack type. Deserialization functions (such as Msgpax.unpack/2) provide an option to deserialize Binary terms (which are deserialized to Elixir binaries by default) to Msgpax.Bin structs.

Link to this section Summary

Functions

Creates a new Msgpax.Bin struct from the given binary.

Link to this section Types

@type t() :: %Msgpax.Bin{data: binary()}

Link to this section Functions

Creates a new Msgpax.Bin struct from the given binary.

examples

Examples

iex> Msgpax.Bin.new("foo")
#Msgpax.Bin<"foo">