XDR kommit v0.1.0 XDR.Union View Source

this module is in charge of process the Discriminated Union types based on the RFC4506 XDR Standard

Link to this section Summary

Functions

this function is in charge of decoding the XDR which represents an Disxriminated Union type, it receives a struct which contains the discriminant which is the principal value to make the Union, and the arms which are the possible values that can be taken by the discriminant, and the specific struct

this function is in charge of decoding the XDR which represents an Disxriminated Union type, it receives a struct which contains the discriminant which is the principal value to make the Union, and the arms which are the possible values that can be taken by the discriminant, and the specific struct

this function is in charge of encoding the Discriminated Union types, it receives a struct which contains the discriminant which is the principal value to make the Union, and the arms which are the possible values that can be taken by the discriminant

this function is in charge of encoding the Discriminated Union types, it receives a struct which contains the discriminant which is the principal value to make the Union, and the arms which are the possible values that can be taken by the discriminant

Link to this section Types

Specs

t() :: %XDR.Union{arms: list(), discriminant: XDR.Enum | XDR.Int | XDR.UInt}

Link to this section Functions

Link to this function

decode_xdr(bytes, union)

View Source

Specs

decode_xdr(bytes :: binary(), union :: map()) :: {:ok, {any(), binary()}}

this function is in charge of decoding the XDR which represents an Disxriminated Union type, it receives a struct which contains the discriminant which is the principal value to make the Union, and the arms which are the possible values that can be taken by the discriminant, and the specific struct

returns an ok tuple which contains the values of the union

Link to this function

decode_xdr!(bytes, union)

View Source

Specs

decode_xdr!(bytes :: binary(), union :: map()) :: {any(), binary()}

this function is in charge of decoding the XDR which represents an Disxriminated Union type, it receives a struct which contains the discriminant which is the principal value to make the Union, and the arms which are the possible values that can be taken by the discriminant, and the specific struct

returns the values of the union

Specs

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

this function is in charge of encoding the Discriminated Union types, it receives a struct which contains the discriminant which is the principal value to make the Union, and the arms which are the possible values that can be taken by the discriminant

returns an ok tuple which contains the binary encoded of the union

Specs

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

this function is in charge of encoding the Discriminated Union types, it receives a struct which contains the discriminant which is the principal value to make the Union, and the arms which are the possible values that can be taken by the discriminant

returns the binary encoded of the union

Link to this function

new(discriminant, arms \\ nil)

View Source