Exgencode.Pdu.Protocol protocol (exgencode v2.4.0)

Link to this section Summary

Functions

Decode a binary into the specified Elixir structure.

Encode the Elixir structure into a binary given the protocol version.

Calculate the values of all offset fields.

Returns the size of the field in bits.

Returns the size of the pdu for given version.

Link to this section Types

Specs

t() :: term()

Link to this section Functions

Link to this function

decode(pdu, binary, version)

Specs

decode(Exgencode.pdu(), binary(), nil | Version.version()) ::
  {Exgencode.pdu(), binary()}

Decode a binary into the specified Elixir structure.

Link to this function

encode(pdu, version)

Specs

encode(Exgencode.pdu(), nil | Version.version()) :: binary()

Encode the Elixir structure into a binary given the protocol version.

Link to this function

set_offsets(pdu, version)

Specs

set_offsets(Exgencode.pdu(), nil | Version.version()) :: Exgencode.pdu()

Calculate the values of all offset fields.

Link to this function

sizeof(pdu, field_name)

Returns the size of the field in bits.

Link to this function

sizeof_pdu(pdu, version, type)

Specs

sizeof_pdu(
  Exgencode.pdu(),
  Version.version() | nil,
  Exgencode.return_size_type()
) :: non_neg_integer() | {:subrecord, Exgencode.pdu()}

Returns the size of the pdu for given version.