Elixir XDR v0.1.4 XDR.FixedArray View Source

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

Link to this section Summary

Types

t()

XDR.FixedArray structure type specification.

Functions

Decode the Fixed-Length Array in XDR format to a XDR.FixedArray structure.

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

Encode a XDR.FixedArray structure into a XDR format.

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

Create a new XDR.FixedArray structure with the elements, type and length passed.

Link to this section Types

Specs

t() :: %XDR.FixedArray{
  elements: list() | nil,
  length: integer(),
  type: module()
}

XDR.FixedArray structure type specification.

Link to this section Functions

Specs

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

Decode the Fixed-Length Array in XDR format to a XDR.FixedArray structure.

Link to this function

decode_xdr!(bytes, fixed_array)

View Source

Specs

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

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

Specs

encode_xdr(fixed_array :: t()) ::
  {:ok, binary()} | {:error, :not_number | :invalid_length | :not_list}

Encode a XDR.FixedArray structure into a XDR format.

Link to this function

encode_xdr!(fixed_array)

View Source

Specs

encode_xdr!(fixed_array :: t()) :: binary()

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

Link to this function

new(elements, type, length)

View Source

Specs

new(elements :: list() | binary(), type :: module(), length :: integer()) :: t()

Create a new XDR.FixedArray structure with the elements, type and length passed.