XDR kommit v0.1.0 XDR.VariableArray View Source

this module is in charge of process the variable array types based on the RFC4506 XDR Standard

Link to this section Summary

Types

t()

Every VariableArray structure has the list of elements to encode, the type of these elements and the max_length of the list

Functions

this function is in charge of decode an XDR into a Variable Array, it receives an XDR.VariableArray structure which contains the data needed to decode the binary

this function is in charge of decode an XDR into a Variable Array, it receives an XDR.VariableArray structure which contains the data needed to decode the binary

this function is in charge of encode a Variable Array into an XDR, it receives an XDR.VariableArray structure which contains the data needed to encode the variable array

this function is in charge of encode a Variable Array into an XDR, it receives an XDR.VariableArray structure which contains the data needed to encode the variable array

this function provides an easy way to create an XDR.VariableArray type, it receives an XDR.VariableArray structure which contains the data needed to encode the Variable Array

Link to this section Types

Specs

t() :: %XDR.VariableArray{
  elements: list() | binary(),
  max_length: integer(),
  type: module()
}

Every VariableArray structure has the list of elements to encode, the type of these elements and the max_length of the list

Link to this section Functions

Specs

decode_xdr(bytes :: binary(), struct :: map()) :: {:ok, {list(), binary()}}

this function is in charge of decode an XDR into a Variable Array, it receives an XDR.VariableArray structure which contains the data needed to decode the binary

returns an :ok tuple with the resulted array

Link to this function

decode_xdr!(bytes, struct)

View Source

Specs

decode_xdr!(bytes :: binary(), struct :: map()) :: {list(), binary()}

this function is in charge of decode an XDR into a Variable Array, it receives an XDR.VariableArray structure which contains the data needed to decode the binary

returns the resulted array

Specs

encode_xdr(map()) :: {:ok, binary()}

this function is in charge of encode a Variable Array into an XDR, it receives an XDR.VariableArray structure which contains the data needed to encode the variable array

returns an :ok tuple with the resulted XDR

Link to this function

encode_xdr!(variable_array)

View Source

Specs

encode_xdr!(map()) :: binary()

this function is in charge of encode a Variable Array into an XDR, it receives an XDR.VariableArray structure which contains the data needed to encode the variable array

returns the resulted XDR

Link to this function

new(elements, type, max_length \\ 4294967295)

View Source

Specs

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

this function provides an easy way to create an XDR.VariableArray type, it receives an XDR.VariableArray structure which contains the data needed to encode the Variable Array

returns a XDR.VariableArray struct with the value received as parameter