Elixir XDR v0.1.4 XDR.FixedOpaque View Source

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

Link to this section Summary

Types

t()

XDR.FixedOpaque structure type specification.

Functions

Decode the Fixed-Length Opaque Data in XDR format to a XDR.FixedOpaque structure.

Decode the Fixed-Length Array in XDR format to a XDR.FixedOpaque structure. If the binaries are not valid, an exception is raised.

Encode a XDR.FixedOpaque structure into a XDR format.

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

Create a new XDR.FixedOpaque structure with the opaque and length passed.

Link to this section Types

Specs

t() :: %XDR.FixedOpaque{length: integer(), opaque: binary() | nil}

XDR.FixedOpaque structure type specification.

Link to this section Functions

Specs

decode_xdr(bytes :: binary(), opaque :: t() | map()) ::
  {:ok, {t(), binary()}}
  | {:error, :not_binary | :not_valid_binary | :not_number | :exceed_length}

Decode the Fixed-Length Opaque Data in XDR format to a XDR.FixedOpaque structure.

Link to this function

decode_xdr!(bytes, opaque)

View Source

Specs

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

Decode the Fixed-Length Array in XDR format to a XDR.FixedOpaque structure. If the binaries are not valid, an exception is raised.

Specs

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

Encode a XDR.FixedOpaque structure into a XDR format.

Specs

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

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

Specs

new(opaque :: binary(), length :: integer()) :: t()

Create a new XDR.FixedOpaque structure with the opaque and length passed.