XDR.Union (Elixir XDR v0.3.11) View Source

This module manages the Discriminated Union type based on the RFC4506 XDR Standard.

Link to this section Summary

Types

t()

XDR.Union structure type specification.

Functions

Decode the Discriminated Union in XDR format to a XDR.Union structure.

Decode the Discriminated Union in XDR format to a XDR.Union structure. If the binaries are not valid, an exception is raised.

Encode a XDR.Union structure into a XDR format.

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

Create a new XDR.Union structure with the discriminant, arms and value passed.

Link to this section Types

Specs

arms() :: keyword() | map()

Specs

discriminant() :: XDR.Enum.t() | XDR.Int.t() | XDR.UInt.t() | struct()

Specs

t() :: %XDR.Union{arms: arms(), discriminant: discriminant(), value: any()}

XDR.Union structure type specification.

Link to this section Functions

Link to this function

decode_xdr(bytes, union)

View Source

Decode the Discriminated Union in XDR format to a XDR.Union structure.

Link to this function

decode_xdr!(bytes, union)

View Source

Decode the Discriminated Union in XDR format to a XDR.Union structure. If the binaries are not valid, an exception is raised.

Encode a XDR.Union structure into a XDR format.

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

Link to this function

new(discriminant, arms, value \\ nil)

View Source

Specs

new(discriminant :: discriminant(), arms :: arms(), value :: any()) :: t()

Create a new XDR.Union structure with the discriminant, arms and value passed.