Elixir XDR v0.1.5 XDR.Optional View Source

This module manages the Optional-Data type based on the RFC4506 XDR Standard.

Link to this section Summary

Types

t()

XDR.Optional structure type specification.

Functions

Decode the Optional-Data in XDR format to a XDR.Optional structure.

Decode the Optional-Data in XDR format to a XDR.Optional structure. If the binaries are not valid, an exception is raised.

Encode a XDR.Optional structure into a XDR format.

Encode a XDR.Optional structure into a XDR format. If the optional is not valid, an exception is raised.

Create a new XDR.Optional structure with the type passed.

Link to this section Types

Specs

t() :: %XDR.Optional{type: nil | any()}

XDR.Optional structure type specification.

Link to this section Functions

Specs

decode_xdr(bytes :: binary(), optional :: t() | map()) ::
  {:ok, {t(), binary()}} | {:error, :not_binary | :not_module}

Decode the Optional-Data in XDR format to a XDR.Optional structure.

Link to this function

decode_xdr!(bytes, optional)

View Source

Specs

decode_xdr!(bytes :: binary(), optional :: t() | map()) :: {t(), binary()}

Decode the Optional-Data in XDR format to a XDR.Optional structure. If the binaries are not valid, an exception is raised.

Specs

encode_xdr(optional :: t()) :: {:ok, binary()} | {:error, :not_valid}

Encode a XDR.Optional structure into a XDR format.

Specs

encode_xdr!(optional :: t()) :: binary()

Encode a XDR.Optional structure into a XDR format. If the optional is not valid, an exception is raised.

Specs

new(type :: any()) :: t()

Create a new XDR.Optional structure with the type passed.