xdr v0.1.2 XDR.Type.Enum View Source

RFC 4506, Section 4.3 - Enumeration

Link to this section Summary

Types

t()

A keyword list defining the spec for an Enum, where values are 4-byte integers

Functions

Decodes a 4-byte binary and enum spec into the binary’s enum spec name

Encodes an atom name and enum spec into the name’s enum spec 4-byte binary

Determines if an atom name is valid according to the enum spec

Link to this section Types

Link to this type decode_error() View Source
decode_error() :: {:error, :invalid_xdr | :invalid_enum}
Link to this type encode_error() View Source
encode_error() :: {:error, :invalid | :invalid_name | :invalid_enum}

A keyword list defining the spec for an Enum, where values are 4-byte integers

Link to this section Functions

Link to this function decode(xdr, enum) View Source
decode(xdr :: xdr(), enum :: spec()) ::
  {:ok, {name :: t(), rest :: XDR.Type.Base.xdr()}} |
  decode_error()

Decodes a 4-byte binary and enum spec into the binary’s enum spec name

Link to this function encode(name, enum) View Source
encode(name :: t(), enum :: spec()) ::
  {:ok, xdr :: xdr()} |
  encode_error()

Encodes an atom name and enum spec into the name’s enum spec 4-byte binary

Link to this function valid?(name, enum) View Source
valid?(name :: t(), enum :: spec()) :: boolean()

Determines if an atom name is valid according to the enum spec