xdr v0.1.1 XDR.Type.FixedArray View Source

RFC 4506, Section 4.12 - Fixed-length Array

Link to this section Summary

Types

t()

A binary of any length

Functions

Decodes an fixed array xdr binary by truncating it to the desired length

Encodes a fixed array into a binary

Determines if a value is a binary of a valid length

Link to this section Types

Link to this type decode_error() View Source
decode_error() :: {:error, reason :: :invalid | :xdr_too_small}
Link to this type len() View Source
len() :: non_neg_integer()

A binary of any length

Link to this section Functions

Link to this function decode(xdr, type, len) View Source
decode(xdr :: xdr(), type :: module(), len :: len()) ::
  {:ok, {array :: t(), rest :: XDR.Type.Base.xdr()}} |
  decode_error()

Decodes an fixed array xdr binary by truncating it to the desired length

Link to this function encode(array, type, len) View Source
encode(array :: t(), type :: module(), len :: len()) ::
  {:ok, xdr :: xdr()} |
  {:error, :invalid}

Encodes a fixed array into a binary

Link to this function valid?(array, type, len) View Source
valid?(array :: t(), type :: module(), len :: len()) :: boolean()

Determines if a value is a binary of a valid length