Elixir XDR v0.1.5 XDR.Enum View Source

This module manages the Enumeration type based on the RFC4506 XDR Standard.

Link to this section Summary

Types

t()

XDR.Enum structure type specification.

Functions

Decode the Enumeration in XDR format to a XDR.Enum structure.

Decode the Enumeration in XDR format to a XDR.Enum structure. If the binaries are not valid, an exception is raised.

Encode a XDR.Enum structure into a XDR format.

Encode a XDR.Enum structure into a XDR format. If the declarations or identifier of the enum is not valid, an exception is raised.

Create a new XDR.Enum structure with the declarations and identifier passed.

Link to this section Types

Specs

t() :: %XDR.Enum{declarations: keyword(), identifier: atom()}

XDR.Enum structure type specification.

Link to this section Functions

Specs

decode_xdr(bytes :: binary(), enum :: t()) ::
  {:ok, {t(), binary()}} | {:error, :not_binary | :not_list | :invalid_key}

Decode the Enumeration in XDR format to a XDR.Enum structure.

Link to this function

decode_xdr!(bytes, enum)

View Source

Specs

decode_xdr!(bytes :: binary(), enum :: t()) :: {t(), binary()}

Decode the Enumeration in XDR format to a XDR.Enum structure. If the binaries are not valid, an exception is raised.

Specs

encode_xdr(map()) ::
  {:ok, binary()} | {:error, :not_list | :not_an_atom | :invalid_key}

Encode a XDR.Enum structure into a XDR format.

Specs

encode_xdr!(enum :: t()) :: binary()

Encode a XDR.Enum structure into a XDR format. If the declarations or identifier of the enum is not valid, an exception is raised.

Link to this function

new(declarations, identifier)

View Source

Create a new XDR.Enum structure with the declarations and identifier passed.