XDR kommit v0.1.0 XDR.Enum View Source

This module is in charge to process the Enum type based on the RFC4506 XDR Standard

Link to this section Summary

Types

t()

Every enum structure has a declaration list which contains the keys and its representation value

Functions

This function is in charge of decode the XDR which represents a value inside an enum structure,it receives an XDR.Enum structure that contains the identifier and the enum which it belongs

This function is in charge of decode the XDR which represents a value inside an enum structure,it receives an XDR.Enum structure that contains the identifier and the enum which it belongs

This function is in charge of encode a value inside of the enum structure based on the identifier received by parameter, it receives a XDR.Enum type which contains the Enum and the identifier which you need to encode

This function is in charge of encode a value inside of the enum structure based on the identifier received by parameter, it receives a XDR.Enum type which contains the Enum and the identifier which you need to encode

Link to this section Types

Specs

t() :: %XDR.Enum{declarations: keyword(), identifier: atom()}

Every enum structure has a declaration list which contains the keys and its representation value

Link to this section Functions

Specs

decode_xdr(binary(), map()) :: {:ok, {t(), binary()}}

This function is in charge of decode the XDR which represents a value inside an enum structure,it receives an XDR.Enum structure that contains the identifier and the enum which it belongs

Returns a tuple with the key of the decoded enum and the remaining bytes if there are.

Link to this function

decode_xdr!(bytes, struct)

View Source

Specs

decode_xdr!(binary(), map()) :: {t(), binary()}

This function is in charge of decode the XDR which represents a value inside an enum structure,it receives an XDR.Enum structure that contains the identifier and the enum which it belongs

Returns the key of the decoded enum and the remaining bytes if there are.

Specs

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

This function is in charge of encode a value inside of the enum structure based on the identifier received by parameter, it receives a XDR.Enum type which contains the Enum and the identifier which you need to encode

Returns a tuple with the the XDR resulted from encode the value wich represents a key in the enum structure

Specs

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

This function is in charge of encode a value inside of the enum structure based on the identifier received by parameter, it receives a XDR.Enum type which contains the Enum and the identifier which you need to encode

Returns the XDR resulted from encode the value wich represents a key in the enum structure

Link to this function

new(declarations, identifier)

View Source