Elixir XDR v0.1.1 XDR.Type protocol View Source

Link to this section Summary

Types

t()

Any XDR.Type implementation

Functions

Create a fully-configured type by supplying options such as length for an Array, fields for a Struct, or arms for a Union

Given a type and a value compatible with the type, construct a new struct of the same type with the value applied

Given a binary with the given type encoded at its head decode the XDR representation and return a tuple of the type with value and the remaining binary after the type

Given a type with a value already applied, encode the value into its binary XDR representation

Given a type with a value already applied, extract the value only.

Perform the necessary lookups using the custom_types map to resolve any subsidiary types.

Link to this section Types

Link to this section Functions

Link to this function

build_type(type, options)

View Source

Create a fully-configured type by supplying options such as length for an Array, fields for a Struct, or arms for a Union

Link to this function

build_value!(type, value)

View Source

Given a type and a value compatible with the type, construct a new struct of the same type with the value applied

Given a binary with the given type encoded at its head decode the XDR representation and return a tuple of the type with value and the remaining binary after the type

Link to this function

encode!(type_with_value)

View Source

Given a type with a value already applied, encode the value into its binary XDR representation

Link to this function

extract_value!(type_with_values)

View Source

Given a type with a value already applied, extract the value only.

Link to this function

resolve_type!(type, custom_types)

View Source

Perform the necessary lookups using the custom_types map to resolve any subsidiary types.

For example, a Struct's fields may be custom types (referenced via a string) that need to be resolved into the appropriate XDR.Type structs