Elixir XDR v0.1.1 XDR.Type.Union View Source

A Union is a polymorphic type. It has a switch of type enum or int, whose value determines the type of the union's data.

TODO

  • finish support for a default arm

Link to this section Summary

Link to this section Types

Link to this type

options()

View Source
options() :: [
  arms: keyword(XDR.Type.t()),
  switch_name: String.t() | atom(),
  switch_type: XDR.Type.t(),
  switches: [switch()],
  default_arm: atom()
]
Link to this type

switch()

View Source
switch() :: {switch_value(), atom() | XDR.Void | XDR.Void.t()}
Link to this type

switch_value()

View Source
switch_value() :: atom() | integer()
Link to this type

t()

View Source
t() :: %XDR.Type.Union{
  arms: [XDR.Type.t()],
  default_arm: atom() | nil,
  switch: term(),
  switch_name: String.t() | atom() | nil,
  switches: [switch()],
  type_name: String.t(),
  value: XDR.Type.t()
}

Link to this section Functions

Link to this function

get_value_type(type, switch_type_with_value)

View Source
Link to this function

validate_type_options!(options)

View Source