Elixir XDR v0.1.5 XDR.VariableOpaque View Source

This module manages the Variable-Length Opaque Data type based on the RFC4506 XDR Standard.

Link to this section Summary

Types

t()

XDR.VariableOpaque structure type specification.

Functions

Decode the Variable-Length Opaque Data in XDR format to a XDR.VariableOpaque structure.

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

Encode a XDR.VariableOpaque structure into a XDR format.

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

Create a new XDR.VariableOpaque structure with the opaque and max_size passed.

Link to this section Types

Specs

t() :: %XDR.VariableOpaque{max_size: integer(), opaque: binary() | nil}

XDR.VariableOpaque structure type specification.

Link to this section Functions

Link to this function

decode_xdr(bytes, opaque \\ %{max_size: 4294967295})

View Source

Specs

decode_xdr(bytes :: binary(), opaque :: t()) ::
  {:ok, {t(), binary()}}
  | {:error,
     :not_binary
     | :not_number
     | :exceed_lower_bound
     | :exceed_upper_bound
     | :length_over_max
     | :length_over_rest}

Decode the Variable-Length Opaque Data in XDR format to a XDR.VariableOpaque structure.

Link to this function

decode_xdr!(bytes, opaque \\ %{max_size: 4294967295})

View Source

Specs

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

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

Specs

encode_xdr(opaque :: t()) ::
  {:ok, binary()}
  | {:error,
     :not_binary
     | :not_number
     | :exceed_lower_bound
     | :exceed_upper_bound
     | :invalid_length}

Encode a XDR.VariableOpaque structure into a XDR format.

Specs

encode_xdr!(opaque :: t()) :: binary()

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

Link to this function

new(opaque, max_size \\ 4294967295)

View Source

Specs

new(opaque :: binary() | nil, max_size :: integer()) :: t()

Create a new XDR.VariableOpaque structure with the opaque and max_size passed.